News:

  • July 03, 2026, 04:24:01 AM

Login with username, password and session length

Author Topic: Sending data to a network connected ViewMarq from a Do-More CPU  (Read 8777 times)

Scot

  • Sr. Member
  • ****
  • Posts: 78
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?

plcnut

  • Hero Member
  • *****
  • Posts: 814
    • premiersi.com
Re: Sending data to a network connected ViewMarq from a Do-More CPU
« Reply #1 on: August 06, 2015, 01:50:35 PM »
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.
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com

Scot

  • Sr. Member
  • ****
  • Posts: 78
Re: Sending data to a network connected ViewMarq from a Do-More CPU
« Reply #2 on: August 06, 2015, 02:23:14 PM »
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.

plcnut

  • Hero Member
  • *****
  • Posts: 814
    • premiersi.com
Re: Sending data to a network connected ViewMarq from a Do-More CPU
« Reply #3 on: August 06, 2015, 02:37:39 PM »
You could certainly do it with only one MWX, but when there is a problem you may not know why.
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com

plcnut

  • Hero Member
  • *****
  • Posts: 814
    • premiersi.com
Re: Sending data to a network connected ViewMarq from a Do-More CPU
« Reply #4 on: August 06, 2015, 02:47:35 PM »
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.
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com