Read a text file in RSLogix 5000

prats33

Member
Join Date
Dec 2013
Location
quatar
Posts
8
I am trying to read from a text file in RSLogix 5000.Based on the strings read from the file i have to send some output.the later part is taken care of but i am unable to figure out how i can read from text file.any help would be appreciated :)
 
Tell me if I'm correct:

You have a text file on a computer hard drive, you need to open the text file, read it, if there is certain text in the file, trigger an output in the PLC. Does that sound correct?

edit: And when I say "you" I don't mean you specifically, but you need an automated way to handle this.
 
I would handle this using AdvancedHMI

You would have to write some VB to read the text file and decide if it's contents contained what you were looking for. Then you could use one of its drivers to send a command to the PLC to trigger your output.

You would also probably need to monitor a tag (probably with the data subscriber component) that would tell your VB code when to check the text file.

If you need more specifics on anything, the please provide more detail on your system and we can help.
 
the text file i am trying to read is actually some G-code.Based on instructions given on each line in the G-code I will move X and Y motors.I was thinking that there must be some way to kinda import/read the whole text file into RSLogix5000. Then each string will be triggering some movement.For HMI , i am using Factory Talk View.
I will see if i could do it using VB.
Thanks dmroeder....
 
Do the contents ever change in this text file? Or would this be a one time import?

Can you give me an example of what one of the lines looks like?
 
content will change during different imports.The text file is a typical G-code(with assumption that it doesn't contain any syntactic errors).
for example G-code may look like..
N00 M03 G91
N05 G01 X00 Y10
N10 G03 X10 Y20 R-13
....
..
 
You said you are using Factory Talk View, does this mean the system has a PanelView Plus? So you probably don't have a PC involved in the system to run any VB code do you?

I'm not sure of a way to handle the import you are after without using a PC and some custom code. Maybe someone else will have a better way.

edit: I wasn't familiar with G-code, so I just looked it up
 
You said you are using Factory Talk View, does this mean the system has a PanelView Plus? So you probably don't have a PC involved in the system to run any VB code do you?

Could be he's using SE

If so, you can write VBA to read the file, parse the data into tags that are defined in Enterprise as PLC tags.
 
I am doing all this on a PC. RSLogix 5000 and Factory Talk View are installed on the same pc. I am not using Panel View.I have one Allen-Bradely controller PLC and two sarcose drives.SO, the only way to so this is using VB,right?

..Yes,I am using the site edition of Factory talk view..
 
I wouldn't say the only way, but maybe the easiest (at least for me).

Nailed it robertmee! Your suggestion will probably work out the cleanest.
 
thanks a lot folks..but i am totally new to these softwares..can u plz post some link to any tutorial that tells how i can give input from text file to rslogix5000 using vba ..thanks again :)
 
I am able to create excel vba to read my text file.To link vba and RSLogix5000 i am using DDE. I searched for DDE methods but i am unable to figure out what i should write as the second argument of DdeRequest() method.
My text file looks like this.
G00 X34 Y45
G01 X12 Y4
...
..
When i find G00 i want to update a string tag in my ladder logic.please tell me how i should write the address of this string tag in the parameter of DdeRequest() method.And if there is any other method for linking excel vba with RSlogix5000, do share :)

I took reference from here-:
http://www.plcdev.com/book/export/html/609
 

Similar Topics

Hello I am using codesys v3.5. I am using the CAA File library to read/write lines of text from a file stored on my Festo PLC. I have found out...
Replies
1
Views
6,253
I have to read a text file from a USB stick somehow extract the relevant data into a PLC. The system is based around a 840DSL NCU730.3 and a...
Replies
3
Views
3,661
How to read and write text file in Citect Scada? I want to write to text file when engineer change the set point. I want to get that changed...
Replies
0
Views
4,020
Dear, I want to write data into a txt or csv file. This data contains text and numbers. Later I want to read some of that data into the...
Replies
0
Views
5,247
Hello everyone, I'm fairly new in PLC programming. I've only done 2 programs with supervision. MY PROJECT: I have a PC base OCR system that...
Replies
20
Views
6,816
Back
Top Bottom