Host Engineering Forum
General Category => Do-more CPUs and Do-more Designer Software => Topic started by: Scot on August 06, 2015, 12:57:37 PM
-
I've just started working with both a ViewMarq display and my first Do-More CPU (the Ethernet model).
I noticed in the tutorials that sending a string to a ViewMarq is pretty easy when using a serial connection.
But, my ViewMarq is on a TCP connection. The instructions for that are much more complex with having to convert the string from a SL memory location to a V location and using a MWX modbus network write command and 2 more MRX modbus read commands to verify the communication worked.
Am I missing a more simple way to send a SS or SL string variable to a ViewMarq over TCP?
-
I do not have a ViewMarq to test with, but I will attach a simple program that was made according to the ViewMarq manual, but also leverages some of the modularity that DMD offers.
I hope it helps.
-
I did do that string conversion. Thanks though.
Beyond that, there's the Modbus writing and reading. I was just hoping there was a way to setup the ViewMarq in the device list and then just Streamout a string to it and not have to use Modbus commands.
I found some samples for modbus tcp and am testing that out. It just uses a lot of discrete bits and registers and isn't very elegant.
I have 3 different write stages. One to set the message (I'm going to use a large message list saved to the ViewMarq and just have a stage for each message). One stage is the set the message number <ID 1><DO n>. Another stage is to set variables as they change. The last stage is to set the minute and second variables for a timer display once per second.
I'm a little curious what would happen if I didn't follow all of the handshaking in the manual examples and just converted the string, wrote it with a MWX, then ended the stage. Each ViewMarq communication stage would be 1 rung instead of 11.
-
You could certainly do it with only one MWX, but when there is a problem you may not know why.
-
Also, I am not sure if/why you are worried about the program size, but if you look at the example I posted, you will see that there is a dedicated program block that takes care of all the ViewMarq comms, also there is a dedicated Task block that takes care of all of the String assembly (If you add a simple index to select the messages).
There is no need to have to rewrite all that code for every message, and it would take a huge program to actually run out of program memory in a Do-more.