1
Do-more CPUs and Do-more Designer Software / Re: How to set up Ascll
« Last post by Greg on Today at 02:35:55 PM »PLCwannabe,
Actually, I think franji1 meant to say for you to use the STRGETB "Get Bytes Out of a String", not the STRPUTB. I still get those swapped because it seems counterintuitive when you are going one way instead of the other. So...
All this should work just fine unless your 4-line display is expecting the ASCII characters in a different order (which has been the case plenty of times in my experience). Of course, if they show up weird on your display, then you may have to use something like the PUBLISH instruction to swap bytes.
Actually, I think franji1 meant to say for you to use the STRGETB "Get Bytes Out of a String", not the STRPUTB. I still get those swapped because it seems counterintuitive when you are going one way instead of the other. So...
- Execute a STRPRINT to put whatever ASCII text you want into, say, SS0 (e.g. "My dog has fleas.")
- Execute a STRGETB to get the ASCII bytes out of SS0, starting at Index zero, and the Length can be, e.g. fixed, or maybe SS0.Length, and stuff them into, e.g. V100 like franji1 said. In the example string I mentioned, this will stuff "M" (ASCII 0x4D) into V100:B0, and "y" (ASCII 0x79) into V100:B1, etc. If you looked at these in Data View, in ASCII format, you'd see them.
- Execute the MWX that will write this data, starting in V100, either a fixed length or the variable length, to your Modbus RTU slave/server.
All this should work just fine unless your 4-line display is expecting the ASCII characters in a different order (which has been the case plenty of times in my experience). Of course, if they show up weird on your display, then you may have to use something like the PUBLISH instruction to swap bytes.