Host Engineering Forum
General Category => Do-more CPUs and Do-more Designer Software => Topic started by: RBPLC on March 28, 2021, 07:13:46 AM
-
I am currently using BRX to Modbus read ASCII coded characters from one device. Characters come into BRX correctly and ASCII values are displayed correctly in BRX when choosing ASCII in the Data view. I'm try to combine several of these read characters into a string that can be sent to a C-More panel. For example, I'm trying to take ASCII coded characters in V100-V109, combine them together to form a word which is stored in ss100 and have this sent to C-More. I've tried STRPRINT but all I'm able to do is store the integer representations into ss100. What am I missing?
-
Can you target a string with MEMCOPY? I don't think so.
Look at STRPUTB and STRGETB.
-
The other option would be to get everything lined up in contiguous numeric memory and tell the C-More to display as text.
-
Figured it out. Within STRPRINT: Print to SS100, Raw(V100,1) Raw(V101,1)...
-
Figured it out. Within STRPRINT: Print to SS100, Raw(V100,1) Raw(V101,1)...
Thank you! I have some places I'm using STRxxxB, whichever it is, and I think I might like that better!
-
There's overlap, but STRXXXB was intended to move the entire string content in and out for comms, whereas Raw() was for building strings.
-
I'm squarely in the overlap. STRxxxB is being used to import bytes from HMI MHR, but then they're used as building blocks for longer strings anyway, so I could go either way. Will see which way feels cleaner.