MrPLC Member
  • Content count

  • Joined

  • Last visited

Community Reputation

2 Neutral

About JouniK

  • Rank

Contact Methods

  • Website URL http://
  • ICQ 0

Profile Information

  • Gender Male
  • Country Finland
  1. BeckHoff programming

    This is not exactly Beckhoff tutorial, but for ST you could start with this: And there's some youtube videos: + plenty more. and Beckhoff infosys online:
  2. I have only used it so, that the engineering tools are on the remote PC and i connect with team viewer and use the engineering tools remotely. I do not know, if it's possible to have your setup with team viewer.
  3. TwinCat chronometer

    To count the cycles, first get the task number: TaskIndexID( index => TaskNr ); (* Get this tasks number *) Then get the cycletime from SystemTaskInfoArr: SystemTaskInfoArr[TaskNr].cycleTime (* cycle time in 100ns *) Then get the cycle count from SystemTaskInfoArr: SystemTaskInfoArr[TaskNr].cycleCount and you can use those to calculate passed time PassedTime:= SystemTaskInfoArr[TaskNr].cycleTime * SystemTaskInfoArr[TaskNr].cycleCount; If cycle time gets exceeded, you can check the cycleTimeExceeded and see the last cycle time lastExecTime from SystemTaskInfoArr and adjust the calculated time with that, but maybe you have some other more pressing issues, if the cycle time gets exceeded than couple of extra ticks in your timer. SystemTaskInfoArr is not visible during offline, but you can see it online in your global variables.
  4. Well there are lots of Flash/eeprom programmers in online stores, so one way would be to get one and backup the eeprom like that and then write it on the new one. Other way would be to desolder the chip and desolder the one on the new PLC and then solder the old chip to the new PLC. There are bits for soldering irons for soldering and desoldering PLCC packaged chips.
  5. CRC 8 Calculator

    Here's one version. In that code of yours, the function reads the data with the "data" pointer one byte at a time and does the CRC check until it hits 0x00 byte, which would be the end of the string. Also i do not know C#, but what i fould out is that there is no unsigned char in C#, rather you're supposed to use byte, so my version uses byte. Also there is no rotate in C# according to what i found, but the >> is a shift, so that comment in the code is not true. Also instead of using the pointer way of doing it, the data is passed to this function as a parameter (in this example, it's a byte array from 0 to 2, giving 3 bytes). You can change that however you need. You maybe should also rename the variables better than A and B, i just did that, so you could better compare the C# code and the ST code. Hopefully you have some way of verifying the result. I just quickly checked that it does what the comments say, but there could be bug(s). Here's your code with my added comments: unsigned char CalcCRC8(unsigned char *Data) { unsigned char LoopCntr; unsigned char A; unsigned char B; unsigned char CRC8 = 0; B = 0; // B is the index for pointing to new byte while (*(Data + B)){ // while pointer points to data that isn't 0x00, which would mark the end of the "string" A = *(Data + B); // copy the data to A for (LoopCntr = 0; LoopCntr < 8; LoopCntr++, A >>= 1){ // 8 bit loop if ((A ^ CRC8) & 0x01){ // test bit 0 of (Data XOR CRC8) CRC8 ^= 0x18; // toggle bits 3 and 4 of CRC8 CRC8 >>= 1; // rotate right CRC8, 1 time CRC8 |= 0x80; // set bit 7 of CRC8 } else { CRC8 >>= 1; // rotate right CRC8, 1 time } } B++; // Byte handled, increment index for next byte } return CRC8; // return CRC8 } Here's the code for twincat: FUNCTION CRC8 : BYTE VAR_INPUT Data : ARRAY[0..2] OF BYTE; END_VAR VAR B : BYTE; (* data index *) LoopCntr: BYTE; (* Bit loop counter *) A: BYTE; (* Temporary data byte *) END_VAR CRC8:= 0; (* reset CRC *) B:= 0; (* Reset index *) WHILE ( B < 3 ) DO (* while not end of data *) A:= data[B]; (* Read data to A *) LoopCntr:= 0; (* Reset loop counter *) WHILE ( LoopCntr < 8 ) DO (* 8 bit loop *) IF (((A XOR CRC8) AND 16#01) > 0) THEN (* test bit 0 OF (Data XOR CRC8) *) CRC8:= CRC8 XOR 16#18; (* toggle bits 3 AND 4 OF CRC8 *) CRC8:= SHR(CRC8, 1); (* shift RIGHT CRC8, 1 TIME *) CRC8:= CRC8 OR 16#80; (* set bit 7 OF CRC8 *) ELSE CRC8:= SHR(CRC8, 1); (* shift right CRC8, 1 time *) END_IF; LoopCntr:= LoopCntr + 1; (* Increase loop counter for next bit *) A:= SHR(A,1); (* Shift data 1 bit right *) END_WHILE; B:= B + 1; (* Increment index for next byte *) END_WHILE;
  6. Twincat beginner

    That's pretty much how it works. If it's a beckhoff module, you can just select it from the list, no need for any files, but other manufacturers stuff need the file, naturally. One thing is that, it's better to scan the PLC hardware and then add the modules(unless you happen to have all the modules with power, you can scan them all, which is the best option), because it's hard to know the exact configuration of the PLC. Unfortunately beckhoff doesn't give the basic configurations for the PLCs (i've asked, when i needed to start a project, but didn't have the PLC hardware at hand, atleast they didn't because they didn't have that PLC available to them at that moment), so you might have to just add something and add the correct PLC configuration later.
  7. Cannot Install Omron Minilss Program

    Neither syswin or cx program SKxx and SPxx logics. Bluebyu It's not LSS we are talking about, it's minilss, it's for SK and SP logics. You do not need to install minilss, it runs fine without intalling. Just unpack it and type minilss. The other thing i've told people in these forums before is that i've personally run it with a pentium mmx (130 or 160 Mhz can't remember) and it worked, but it didn't work with a P2 400Mhz. I didn't try it with a slowdown software (which you might want to try. There's a free software called slowdown, check it out) Btw this forum doesn't work right on mozilla, This thing i'm writing into is ontop of the smiley-ad.
  8. NT20M-DT131

    My 2nd NT20M, which has s-ram, has a chip from SEC Km681000BLP-7L, which is a 128KB chip. Chips from other manufacturers work too and it can be smaller, don't know if it can be bigger. I don't know the speed requirement, but i think you can find that info from the NT20M manual.
  9. NT20M-DT131

    EEPROM is Electronically Erasable Programmable Read Only Memory and the NT unit can program it. Obviously you need to switch the memory type selection switch back to eeprom. I have no idea why there's a problem where you can't get to the transmit mode when eeprom is selected. I guess you just have to play with the switches.
  10. to run mini lss DOS software

    If i remember correctly, you really don't need to install it. just run it where you've unpacked it. Then you have to slow down your computer, because it won't run on today's fast computers(cause it's badly written). To slow down the machine, use a tool like slowdown. I tried running it on a 400Mhz PII and it wouldn't run. I haven't tested it with slow down tool though. It runs fine with atleast with a 150 Mhz Pentium mmx and below (from my personal experience).
  11. NT20M-DT131

    Are you sure your cable is correct and otherwise working?
  12. LSS Software

    or you can use a free utility called slowdown to slow down the computer
  13. SYSWIN 3.4

    Heh, NP, good thing you found the cause.
  14. SYSWIN 3.4

    Weird, something must've changed between the tries. The only thing comes to mind is some sort of problem with the cable, but i don't know.
  15. SYSWIN 3.4

    These settings have worked for my C28K and lk201 hostlink unit, though i have only tried it with syswin 3.2( if that makes any difference). I haven't changed them: SW1: machine no: 0 parity: even data format: ascii power on: program (in other words all from SW0 are set to 0) SW2: baud rate 9600 SW3: default (dip 1 =1, the rest are 0)