ASCII Message

Greg Dake

Member
Join Date
Jun 2005
Location
Milwaukee, Wi
Posts
550
Greetings everyone. There's something I'm not quite grasping about the ASCII buffer in a Compact Logix processor. I have attached a file with the program I wrote which communicates to a message display. This program is only a start, and works for my first screen presentation I'm doing, with the exeption of a bug I can't find. Let me explain what the code is doing :

In the DYNAC_LEVEL_MESSAGE subroutine :

Rung 0 and 1 write once to the message display, doing a display reset and displaying some static data.

Rung 4-7 are converting DINT to STRING and then inserting the dynamic number or Dynac level into a static string.

Rung 8-11 then write the string to the display to show dynamic levels in the dynacs.

This works great for a little bit, then the dynamic number that is sent by the AWT in rung 11 dissapears, then a little later the dynamic number that is sent by the AWT in rung 10 dissapears, then a little later the dynamic number that is sent by the AWT in rung 9 dissapears. The funny thing is that the dynamic number that is sent by the AWT in rung 8 never dissapears...

Another thing that happens if I slow the two timers down, the rate of dissapearance slows as well. This leads me to believe I'm filling up a buffer, in the processor? I used and ACL instruction in rung 12 to try and clear this, not sure I'm using it correctly. Or is there a diffrent issue? Any help would be appreciated.

TIA,

Greg
 
Problem #1: You should be moving the string length into the serial port control LEN field before each write, (unless you are sure that the number of characters to write is always 30).

Problem #2: You are writing four buffers every single scan (or trying to, depending on the state of the AWT instructions) that the timer is NOT done. Even if you only triggerred the writes on the timer DN bit (XIC, not XIO), you are probably confusing the communications channel...

I'd use the timer to index a counter (say 0 through 3), ever done pulse, build the appropriate message (0 through 3 depending on the counter value) into a single message string, say MSG_STRING, then MOV your MSG_STRING.LEN into ASCII_WRITE_CONTROL_BLOCK.LEN (you only need one control block) and finally, last rung, use the timer DN bit to write the MSG_STRING once.

To improve reliability, the AWT rung should have a preclusion for EN as well, so would look something like:

XIC MSG_TIMER.DN XIO ASCII_WRITE_CONTROL_BLOCK.EN BST MOV MSG_STRING.LEN ASCII_WRITE_CONTROL_BLOCK.LEN NXB AWT 0 MSG_STRING ASCII_WRITE_CONTROL_BLOCK 0 0 BND
 
Interesting...

Thanks for the pointers. I have included your two recommendations in the code, however the problem still persists. The diplay shows the proper information. Then the variables (the last 4 AWT's), dissapear. The odd thing is the display will show the last thing it received untill it's sent something different in that location, or unless I do a screen reset. That's why it's odd the dynamic values dissapear one at a time. (but one always remains of the 4). Any other ideas? I have attached the modified code.

TIA,

Greg
 
Interesting.... looks like that should work, unless possibly you need to pad your data fields to always be N characters in length...Single Digits should be _ _ N, Double digits should be _ N N...

Another thing you should do, is only build your message string ONCE before sending it. As in put your DTOS and INSERT above the MOV LEN to LEN branch.

It looks like you are sending the info to an EZMarquee? Those format strings look familiar.
 
Hmmmm...

rdrast, thanks again for the info. Yes, it is an AVG display. Overall the display is okay. There are a few things I don't like. One is tech support, it's hard to talk with someone who isn't reading from a database or isn't playing middleman between you and the person who really knows.

At any rate, yes I agree with not having to execute the DTOS and INSERT every scan. There is no need to pad the data, at least not at this time. I think what may be happening is the buffer in the display is filling up. I'm not sure if the display dumps its buffer once the message is displayed. In AB, this is the case. If I do a screen reset, all is good. My option at this point is doing a periodic screen reset, but the problem with that is the screen goes blank for a second when this happens. Kinda hokey. Any further thoughts?

TIA,

Greg
 
Fortunately you can pad the data fields with a "space" and don't have to use an uderscore or a period. I was initially a little worried...I ended up doing a screen reset when I change screens, so to those viewing the reset seems seamless. I had to come up with multiple other workarounds I felt I shouldn't have had to. Just some odd things with this brand of display. It's the largest display they make, in comparison to the AB model it was less than half the initial cost. Was it worth the extra price savings for a few extra programming headaches? I think so, overall not a bad display.



Greg
 

Similar Topics

Hey everybody, I have two Micrologix 1100 connected via a serial cable between the two 9pin rs232 ports. I am trying to send a simple ASCII...
Replies
4
Views
8,582
Hello All Here is my challenge. I have a leak tester that sends ASCII data out continually during it's test. At the end, it sends the test name...
Replies
1
Views
1,723
I need to modify a texas PLC which uses an ascii message card (500-5022)to send messages to an Allen Bradley DL10 message display. I think the...
Replies
5
Views
3,756
I am trying to set up a 1762-L40AWAR Ser C ML1200 processor to write a message to a LED Sign ALPHA 215R. I wrote a program in basic from the...
Replies
1
Views
2,624
Hi, We couldn’t find anything specific, so am starting a new thread. I’m trying to migrate a config from a ML1400 to a micro820 & am experiencing...
Replies
1
Views
74
Back
Top Bottom