micro 1400

Please share information that you get from your GPS or an example of what you're already trying.

You need at least two program routines: one to use the ASCII port control instructions to bring the data into the controller, and one to use the ASCII parsing instructions to pull the data values out of the string.

Let's take an example of an NMEA sentence:

$GPGGA,123519,4807.038,N,01131.000,E,1,08,0.9,545.4,M,46.9,M,,*47

The MicroLogix serial port in ASCII protocol mode can watch the incoming data string for one or two Termination characters. The default terminator is 0x13 hex (carriage return) because that's a typical end-of-line character in ASCII.

If you make the Termination character the asterisk (0x2A hex), you can use the ASCII Read Line (ARL) character to bring in everything from the $ to the *, then immediately use an ASCII Read (ARD) of 2 bytes to get the checksum.

After you have the NMEA0183 sentence in a String datatype, you can search through it using the ASCII String Search (ASC) instruction. Every time you find a comma, you save the position and use the ASCII String Extract (AEX) instruction to pull out the values.

I'm not an ASCII handling expert but I'll see if I can give you an example.
 
Attached is a sample routine that takes a comma-delimited NMEA sentence and breaks it apart into individual Strings in a MicroLogix 1400.

I don't have any MicroLogix controllers handy so I can't test the physical ASCII port instructions.
 
OK I have a string in ST12:1, now will the data into the micro 1400 change as the input changes or will I need an input to start the scan again? Sorry my knowledge of ASCII is about nonexistant. But I am learning.
 
You're going to need a routine using the ASCII serial port instructions to get the data into the ST12:1 String data file.

ASCII serial port instructions aren't simple. You can only execute one at a time, and they're asynchronous to the program scan.

What I would do is trigger an ASCII Read Line (ARL) instruction every two seconds, based on a repeating timer. This will read the NMEA0183 sentence from the $ to the *.

If the repeating timer gets triggered again and the ARL hasn't completed, instead of executing the ARL, clear the incoming buffer.

If the ARL does complete successfully, perform another instruction, this one an ASCII Read (ARD), of length 2, and place the result in ST12:2. This will read the last two characters of the NMEA sentence, the Checksum. You might want to use these later.

For the purposes of this application, I'm going to start a new thread titled 'Parsing NMEA 0183 Sentences from a GPS using MicroLogix 1400". This has become an application question rather than a product question, and it would make a good Sample Code project.
 
Ok thank you very much for the help so far. I will be looking forward to the new thread.
Thanks again
Mark
 

Similar Topics

Hi! Last few I've been trying to send message from MicroLogix 1400 to Micro 850. Unfortunately every time I failed :banghead:. Did someone tried...
Replies
6
Views
3,194
Hello, There was a mix up in information on some redeployed equipment and two of the micro 1400's that came in were hooked to 120v when they...
Replies
9
Views
1,961
I am trying to exchange data (N registers) to and from a Control Logix PLC. I am programming the messages in the Control Logix program, to...
Replies
7
Views
2,171
Does the 1100 only have 1 high speed counter, but it can have multiple inputs? And so then the 1400 has 6 HSC and you have a choice of multiple...
Replies
1
Views
1,722
Error: "Program in processor has changed causing offline state. Do you want to upload?" RSLogix500 V8.10 Micrologix 1400 Customer wants to add...
Replies
8
Views
2,292
Back
Top Bottom