Saxony Thermal

MrPLC Member
  • Content count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About Saxony Thermal

  • Rank

Profile Information

  • Country United States
  1. Variable device access in gxworks 3

    I like those functions. I will give those a whirl and let you know how it goes. Thanks!
  2. Variable device access in gxworks 3

    I guess I can do this but it's not as explicit as I would like and I think causes me to loop more scan cycles? I will implement this and see. Take D5000.0 as a relay. Then bit shift (SFTL). With each shift the D5000.0 is checked for 1 or 0. In PLC's the bitshift doesn't flow into the neighboring device (unfortunately I would like that to happen for technical reasons, if someone knows how to do that...) so after 8 bit shifts then the device is unchanged and each bit was checked. Then increment to the next device D5000Z0 where we add 1 to Z0 to summon D5001 = D5000Z0. If I wish to inspect 256 devices in a row, then I have to setup device swapings with indexed device numbers like SWAP D5000Z0 D5000Z1 or something logical I have to figure out right now in order to feed all those bytes down to D5000.0 for bit by bit inspection of a 256 device string. I do know that BSFR bit shifts and replaces the vacancy with zeros instead of lopping the byte back around. That is nice. But I don't know how to just push it into the neighboring device.  
  3. Variable device access in gxworks 3

    This D5000Z0 style indexing syntax has worked great but now I have another hurdle: If I wanted to index bit by bit, that syntax does not work anymore. For example I want to do the following: D5000Z0.Z1 (invalid syntax) or D5000.Z1 (invalid syntax) Notice the ( . ) which syntactically accesses that bit of the 16 bits. Below is all we can do: D5000.0 (valid syntax) Where .0 is the zeroth bit which can be .1 or other to index the specific bit of interest. But I can't put Z0 there for variable bit by bit access. I need this so I can increment my way up devices as well as each of the 16 bits of the device in a loop.   Is there an appropriate syntax to do this? I also find it difficult to find where mitsubishi discusses this gxworks 3 specific syntax. I found it for ST but that doesnt help me in ladder specific syntax...
  4. CRC: using different polynomials in GXworks 3

    I was able to get ahold of mitsubishi tech support and they read over the manual with me. They assured me that there is no way to change its polynomial output and were even surprised that some CRC function existed at all. Well, the time has come to make it from scratch in pure LD. Wish me luck. *jack hammer noises
  5. CRC: using different polynomials in GXworks 3

    Anyone have ideas? I have been putting off making a CRC check from scratch in the event we find out how to make this built in checker change polynomial but that time of "putting-off" is nearing an end (not the end of the world, just would save me a ton of time).
  6. Variable device access in gxworks 3

    Hm, I still dont see how that can get into my ladder logic controls to increment my way through a range of devices. But I found the solution. The Z device. The below is working syntax for GXworks3: MOV D4500Z0 D5000Z0   Where, Z is an index register and with the syntax above, it means D(4500 + Z0), and Z0 can be a number you modify with timer loops like ADD K1 Z0.   Here is where I found it. Read just the second reply from JRoss. Quote: " Pick a head address, say D100, and modify it with an index register, say Z0. Then you can call the indexed register like this: D100Z0. The index register acts as an offset, so if Z0 = 3, then you are actually pointing to D[100 + 3] or D103. "   Thanks,  
  7. Variable device access in gxworks 3

    Hello, I appreciate your reply but I do not see how that relates to my challenge. I know I can make arrays and index them to do calculations, but I cant put that into MOV function for a device location for example. Where I need to move a device location that changes with time to a constant device location or a moving one. Like MOV D#a D#b, where MOV will put D#a into D#b where D#a is defined outside of the MOV function and can change, same with D#b. Like a download command message can have varying message length like D#a = D4500 to D#b = D4516, or a longer one like D#a = D4500 to D#b = D4586. Between the two cases, the device location that is holding my CRC bytes is always at the end of the message which are different per message length and I can't have a MOV command to access them for every possibility. I want to make an iterating search function that scans the message device by device, but there does not seem to be a way to process an iteration or loop that changes Device.   Does that make sense?
  8. Variable device access in gxworks 3

    Hello, After a lot of reading I was concluding I would have to do structured text. But then learning structured text I don't see how it solves my issue too. So I am lost: I have incoming messages of variable length. I know what the lengths are because there is a receive counter called SM8561 for the FX5CU CPU over its built-in RS485 port. I have to do a CRC check on it and then interpret the message afterwards to do things. For my CRC, I Omit the ending DLE-ETX. But the device location of DLE-ETX changes with message length. So I can't just say, (the below is not valid syntax, just an expression of what I want to do) if D4500 is start of message and the end of message is always DLE-ETX-CRC-CRC, where the last CRC byte is always device location D(4500+SM8561) //SM8561 is message length [MOV D(4500+ SM8561 - 0) D5000] and [MOV D(4500+ SM8561 - 1) D5000] to move the CRC bytes to another location like D5000 for me to process. I also have to move select bytes from my message to another location and in a continuous run of devices to help with CRC check. These device locations change with message length. I was looking at structured text but its the same issue, I can't assign a variable device number. So how do I process dynamic message lengths? This would be a cake-walk in C, I am just unfamiliar with PLC syntax to do this whether by iteration or logic array.
  9. CRC: using different polynomials in GXworks 3

    attached is the table i saw showing my polynomial of interest. And the path to it in e-manuals. You'll see in that page that it doesnt say how to produce those CRC's, just to be aware of them. There are far more than those polynomials for CRC so I wonder why even bother mentioning a specific few if it couldn't produce them?
  10. Hello,   I tried following this post first but they go a different direction. I want to do a CRC calculation and there is syntax for it already in ladder. But as the linked post says, it is defaulted to a CRC-16 polynomial. I need CRC-CCITT. The manual describes as a precaution that there can be other polynomials and will produce different results... and CRC-CCITT is one of them listed.... Ok... can gxworks3 CRC generator do CRC-CCITT? I do not see how I can instruct it to do that for me. The SM8562 needing to be off for 16bit, and on for 8bit makes me think theres some other SM object to adjust to get my CRC-CCITT?   Does anyone know?   Thanks!
  11. GXworks 3 how to clear a range of devices

    Thank you. You saved me a lot of time!
  12. GXworks 3 how to clear a range of devices

    Hello, simple question, How do I clear a range of devices in ladder in GXworks 3 mitsubishi PLC? I'd like to do something like MOV K0 D4500 D5000 where I put 0 in all devices from D4500 through D5000. I have scanned the documentation for an hour now and not finding how to do this. I also don't see a way to iterate a loop like I might do in C. For now I just made an array of RST D4500, RST D4501, ... and so on for about 20 devices just to keep moving forward with some development. But I need to wipe that whole space easily. Is there a way to input an array for the RST function?   Thanks!
  13. Arithmetic behavior causing a quick zero

    Thank you! I will study this.
  14. Arithmetic behavior causing a quick zero

    Also to your note about 16 or 32 bit results, if it were 32 output it should strongly affect my other arithmetics who rely on that device that may get unintentionally modified. But all my arithmetic results are accurate, just having this sweeping zero... But respecting your thoughts I did the following and I find this to be an acceptable solution. Originally I was using D100 as my buffer to do calculations before sending the final result to d121, for example, via the arithmetic output. If the arithmetic still outputs 32 bit then it captures D122 which is my next analog input result that I don't want to have messed with. So lets back up the buffer entry to D99 so it has D100 to claim making a 32bit buffer (because D101 is one of my raw analog input devices). I then have all arithmetics for all my analog input readings dump into that 32bit buffer, and then add a new MOV step to move just the D99 16bit info to D121. Attached is my new working code. This eliminate my sweeping zero issue. None of my calculations break past 16bits but it is apparent that the arithmetic is 32bit output despite the documentation saying 16bit and was 'capturing' or 'freezing' or 're-initializing' the 32bits to 0 before doing arithmetics, and my sweeping zero was the second byte of that 32 bits that I would see in my HMI. So had my calculations overflowed 16bits, it would probably had shown non-zero instead of a sweeping zero. I supposed my outputs were also always accurate because there was always 0 in the second byte of the arithmetic. If it were non-zero then my other arithmetics would feed in that value and go all bonkers. But zero kept them level headed.   I still, totally, ignored labels in this solution. If you have good documentation or youtube videos on applying labels that would be much appreciated. Otherwise I will keep doing what I know best which is all devices. I spent a good hour trying to figure out the labels but it was fighting me really bad.   Otherwise, thanks very much!! You helped a lot.
  15. Arithmetic behavior causing a quick zero

    I mean, I can get it to change errors doing various foolish combinations of data type and array sizes, but this is not too productive because I don't know what it is asking for. It eventually just says the data type doesn't work with the device. I have been looking around on youtube and am surprisingly not finding any explanations on setting up arithmetics with labels...