|AutomationDirect Live Chat|
Live demo showing how to send long ASCII text messages to the ViewMarq LED Messaging display.
For this video, we have this message which is 327 characters long. Well, that's too many characters to fit into this SL data type we used in the previous video. It can only handle 256 characters. So how do we get around that? Normally, a PLC programmer would break this big long string up into shorter strings and use some interlocking logic - or better yet some stage programming -- to send each part sequentially with the final part having that termination character appended to it for the ViewMarq. And that's certainly do-able. But, with the DoMore, there's a much, much easier way. Since the DoMore memory is completely configurable, why not make your own string variable that is long enough? It's so easy, just right click in the project browser, and select memory configuration. Click add memory block, give it a name -- this is our ViewMarq String, so we'll call it VS -- it's a string data type, and we want it to be able to hold let's say about 500 characters. 512 characters. And we'll go ahead and create, oh I dunno, how about four of these. We can change it later if we want to. That's it, we just created a new memory type, that holds strings, characters, and it is long enough to hold our ViewMarq string. It's warning us that this change can't be written to the DoMore right now because it is running. That's ok; we're going to change it in a minute anyway. Why did we choose 512 characters for this memory type? Because it is lange enough to hold our 327 character message, of course. But more importantly, if we go look at the ViewMarq software, we see that the longest message the ViewMarq software can generate is 500 characters. So 512 characters for our new data type is just about perfect. So to send a LONG ASCII message from the DoMore to the ViewMarq, all we have to do is take that simple short message example we used in the previous video, and modify the data type. So here we go. Let's swap out the SL0 with my new VS String. And of course, we need to use our new string, let me go grab that. Back to the ViewMarq software -- here's my big long string which is generating that display. I say copy, come back to my DoMore software, and swap out the string. If I am careful I can preserve the quotes and my termination character. Let's make sure. Ok we got our opening quote, our end quote and our termination character. Perfect. That will be placed into VS0. Then we come down to STREAMOUT and we say we want to Stream out VS0. And we're done! Now we can send the longest messages the ViewMarq can generate with no effort on our part at all. How about that? I would even suggest you create a ViewMarq message type for all of your message strings. That way you never have to worry about how long your string is. Let's go and accept that. Save it and write it out to the PLC. Let's make sure everybody has their status turned on. And let's go ahead and add that ViewMarq string to our data view. And we'll monitor the length too. I have some stuff in here from a previous example, let me go ahead and get rid of that. Let's just put a couple space characters in there. Ok, so my ViewMarq string has blanks in it. Two of them actually, and we are ready to go. So if I reach down to the DoMore and I flip switch X0, it should place this string into VS0. And sure enough it does. You can see the string here and down here in our data view. Here's the string and here's the number of characters we placed into that string. Now if I reach down to my DoMore and I flip switch X7, it should send that string out STREAMOUT to the internal serial port and of course to the ViewMarq. And sure enough it works exactly like that short string example video BUT we didn't have to do any interlocking code or stage programming or anything. It's easy. Well that ought to be enough to get you going. Check out the other videos to learn more about using the DoMore PLC with the ViewMarq LED display. And let us know if you have any questions. Automation Directs customer support is always free and just a phone call or email away. Spend Less. Do More. From Automation Direct.