Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I parse line by line a DLL or Text file and write it to a device

I need to look at a sample program that can read dll files and be able to parse the file line by line to a device.  Or just to be able to read a text file and parse it line by line.  Parsing should include alphabets and numbers as well as delimiters.  A simple sample program would help out a lot.

Thanks
0 Kudos
Message 1 of 11
(7,142 Views)
It would help if you actually mentioned the language you are using.Smiley Wink
0 Kudos
Message 2 of 11
(7,131 Views)

I am trying to use Labview to parse a C++ function file that is saved as a .DLL file.  Or to just simply parse a Text file line by line

For example

If I had a file like:  P20  L200   X20 Y25 

                            P14 Y29  C799  T19

                        

 

Basically, I want to be able to control an entire process.  I have Vi's I have created for Lasers (L), Powder feeder (P),  X-axis encoder for CNC(X), Y-axis for CNC (Y) devices.  This programs are all controlled via the RT target by their respective cards.  Basically, I hope you kind of understand me and what I am doing.   With the new Labview 8.0 and its project capability seems like it might have the capability of what I need to do.  I want to be able to Call the other vi's and output the values that they need to run at from a main Vi program.  I seems confusing.  I guess I will partly have to explain to you in words.  But as of now, I just need to be able to stream line by line from a file and be able to parse a sample text file as I have show above.

0 Kudos
Message 3 of 11
(7,120 Views)

I am trying to use Labview to parse a C++ function file that is saved as a .DLL file.  Or to just simply parse a Text file line by line

For example

If I had a file like:  P20  L200   X20 Y25 

                            P14 Y29  C799  T19

                         

 

Basically, I want to be able to control an entire process.  I have Vi's I have created for Lasers (L), Powder feeder (P),  X-axis encoder for CNC(X), Y-axis for CNC (Y) devices.  This programs are all controlled via the RT target by their respective cards.  Basically, I hope you kind of understand me and what I am doing.   With the new Labview 8.0 and its project capability seems like it might have the capability of what I need to do.  I want to be able to Call the other vi's and output the values that they need to run at from a main Vi program.  I seems confusing.  I guess I will partly have to explain to you in words.  But as of now, I just need to be able to stream line by line from a file and be able to parse a sample text file as I have show above.

0 Kudos
Message 4 of 11
(7,121 Views)

I am trying to use Labview to parse a C++ function file that is saved as a .DLL file.  Or to just simply parse a Text file line by line

For example

If I had a file like:  P20  L200   X20 Y25 

                            P14 Y29  C799  T19

                          

 

Basically, I want to be able to control an entire process.  I have Vi's I have created for Lasers (L), Powder feeder (P),  X-axis encoder for CNC(X), Y-axis for CNC (Y) devices.  This programs are all controlled via the RT target by their respective cards.  Basically, I hope you kind of understand me and what I am doing.   With the new Labview 8.0 and its project capability seems like it might have the capability of what I need to do.  I want to be able to Call the other vi's and output the values that they need to run at from a main Vi program.  I seems confusing.  I guess I will partly have to explain to you in words.  But as of now, I just need to be able to stream line by line from a file and be able to parse a sample text file as I have show above.

0 Kudos
Message 5 of 11
(7,120 Views)

I am trying to use Labview to parse a C++ function file that is saved as a .DLL file.  Or to just simply parse a Text file line by line

For example

If I had a file like:  P20  L200   X20 Y25 

                            P14 Y29  C799  T19

                           

 

Basically, I want to be able to control an entire process.  I have Vi's I have created for Lasers (L), Powder feeder (P),  X-axis encoder for CNC(X), Y-axis for CNC (Y) devices.  This programs are all controlled via the RT target by their respective cards.  Basically, I hope you kind of understand me and what I am doing.   With the new Labview 8.0 and its project capability seems like it might have the capability of what I need to do.  I want to be able to Call the other vi's and output the values that they need to run at from a main Vi program.  I seems confusing.  I guess I will partly have to explain to you in words.  But as of now, I just need to be able to stream line by line from a file and be able to parse a sample text file as I have show above.

0 Kudos
Message 6 of 11
(7,120 Views)

If I am understanding your question correctly, you don't need to have LabVIEW 8 to be able to parse text files.

Just use LabVIEW's built-in OpenFile and read one line at a time.
There are string parsing capabilities built into LabVIEW.

 

0 Kudos
Message 7 of 11
(7,116 Views)

Could you send me a program how I can read on line at a time...

how can I send an attachment to you so that you can test it.  I need this to be implement on a Serial RS232....That's what I am going to be talking to.  Right now, I can communicate with my RS232 port but somehow I need to figure out how to stream the file line by line to the port or device via labview from the file. 

Thanks

 

Mog

0 Kudos
Message 8 of 11
(7,113 Views)
Look at the functions on your File I/O palette. I don't know if they've changed with 8.0 but every previous version has a function called Read Lines From File. You can read one line or read many. You've got Read From Spreadsheet File that does the same thing and also parses the data on each line. You can also use Read LabVIEW Measurement File for thisIt's generally simpler and faster to read a file all at once with one of these functions. They create arrays than than can be then indexed line by line. Check the shipping examples for "File" examples. There are a lot that you can look at.
0 Kudos
Message 9 of 11
(7,108 Views)
Hi,

to parse things, there are regular expressions ...

As an example, my "LabTab" software has a notation that parses
automatically a binary stream into an array of variants which is then
easy to dispatch in anything as in Excel ...

As an alternative, you might read it in excel and the transfer it in
LabVIEW ...

FG

0 Kudos
Message 10 of 11
(7,014 Views)