12-31-2025 12:42 PM
I'm trying to write data in batch mode to Mitsubishi FX5 PLC using the MELSEC protocol in binary mode (Example on page 77 of the digital document). The problem is that the data frame is built in a manner that uses only a single digit of the hexadecimal number for each device (0 to F instead of 0 to FF). For instance, if I want to turn on two devices I should send the command 11H, if I want to turn off the second device I should send the command as 10H. It is that simple, but I'm struggling because I have 6 devices and I need to do it dinamically according to what the user is selecting. When I take the boolean array from the user interface and try to convert to hex Labview assembles it like this example: [F,T,F,T,F,T] turns into 00 01 00 01 00 01. But I should write the TCP data string like this: 010101. I'm stuck and the only solution I can now think is grouping and setting each pair of devices to assemble the string. Any help or comment is very appreciated.
Thanks and Happy New Year!
12-31-2025 01:09 PM
Here is the only solution (not elegant) I could find so far.
01-01-2026 10:44 AM - edited 01-01-2026 10:45 AM
01-04-2026 06:09 AM
After that I would still need to convert it to a string to send via TCP, but that would definitely work, yes! Thank you very much, indeed it looks a much more elegant solution.
I included the previous solution in the 2021 version.