Saxony Thermal

MrPLC Member
  • Content count

    20
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Saxony Thermal

  • Rank
    Sparky

Profile Information

  • Country United States
  1. 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
  2. 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).
  3. 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,  
  4. 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?
  5. 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.
  6. 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?
  7. Hello,   I tried following this post first but they go a different direction. https://forums.mrplc.com/index.php?/topic/36694-how-to-calculate-crc-gx-works-3-fx5/ 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!
  8. GXworks 3 how to clear a range of devices

    Thank you. You saved me a lot of time!
  9. 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!
  10. Arithmetic behavior causing a quick zero

    Thank you! I will study this.
  11. 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.
  12. 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...
  13. Arithmetic behavior causing a quick zero

    I did find an Array Element option when configuring the label type, but that did not resolve the error adding a second element to the array.
  14. Arithmetic behavior causing a quick zero

    I am using labels now, but please be skeptical of my application of them. I have never used labels before. I get an error when I convert saying to specify an array label of '2' elements or more to the label being used. I attached an image. I'm fiddling with it to try to make it work unless you know what that's all about? The documentation doesn't seem to share what this error means. In C I would assume it just wants me to make an array of 2 elements like [a,b] but I don't know how to do that here. Nor do I understand why? This is a simple multiply operation. The two elements are D101 and AI_CALC_BUFF in this case. Should I also have the raw data from my analog module go into a label as well? The documentation hinted that labels are fussy with 'trigger' events, don't know if that includes my analog module... I'll fidget with that. What do you think?
  15. Accessing specific bits in a word.

    Figured it out. D100.a is the tenth bit. So... D100.A D100.B D100.C D100.D D100.E D100.F It's in hex for selecting which bit to access, but the device number is decimal. Kinda funny but makes sense.