LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA Write and Read function

Solved!
Go to solution

Hi all,

 

I am trying to record data from serial server(which has 16 ports) through com ports ( i am using total 7 ports).

Here I would like to understand VISA function clearly.

 

Question 1

If I just want to record data ( from server ), do i still need VISA write function to read from COM1?

Or

Can i just use VISA read function only and read the string data from com port?

 

Question 2

After I record string data, I will save into a text file.

But what i see inside the save file is just a raw string data ( which i cant really read ).

How can i split those string data into different reading ( different record such as voltage reading, ammeter reading and switch on/off)?

 

Please advise..

 

0 Kudos
Message 1 of 9
(6,304 Views)
Solution
Accepted by topic author wintd

Question 1 - it depends on what's the other end of the serial port. If it is broadcasting data all the time, then a read is all you need. If it needs a command to send you information, then you'll need both. Look at the communication protocol/definition for what you're trying to read back.

 

Question 2 - you'll need to format it. There are a lot of string manipulation VIs on the string pallette, not knowing how the string is formatted at all to begin with I can't give you more advice than that. An example of how you're writing to file, and what you're doing with the received data might be useful... If the data is coming in in one long string, hopefully there are delimiters, and a scan from string will help you highlight them if you need to. If you're reading each port in turn and just concatanting a string, put a tab constant between them (available on the Strings pallette), or any other delimeter you care to use for that matter. Otherwise, if they're all fixed length field the string subset vi could be a way to go.

0 Kudos
Message 2 of 9
(6,293 Views)

Hi KathrynB,

 

Thanks for reply.

I will try to look more into it.

 

One more question here,

I got VISA read error (VISA (Hex 0x3FFF006B) A framing error occurred during transfer.

Why i get this error when i run vi?

 

Thanks in advance.

0 Kudos
Message 3 of 9
(6,244 Views)

This error is a user defined one by the looks of things (unless you've copied the error code in incorrectly by accident), so I'm not sure any of us can help with that. Again, it may be worth looking at the manuals for whatever item it is that you're talking to and seeing if that has an explanation for this error.

0 Kudos
Message 4 of 9
(6,218 Views)

This is a standard VISA error. You might want to check this thread for some insigth to your problem.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 5 of 9
(6,198 Views)

Hi Mark,

 

Thanks for the reply and thread help me to get better understanding.

 

Thanks,

0 Kudos
Message 6 of 9
(6,185 Views)

HEllo there ... 

I am using labview and i want to interface it with a pic microcontroller. 

My task is to send data serially via labview to the pic .

the main task is to send 3 bytes (8 bits each)  from labview to be received from the pic. 

I read the VISA WRITE configuration but i just want to know how to configure those 3 bytes in order to send them serially and to be received by the pic. 

The bytes are ready to be send but i just want to know how to configure the visa write task in order to send them serially to pic.

It will be better if you can provide me with an example that clarify the task.

Thank You.

Best regards,

0 Kudos
Message 7 of 9
(5,997 Views)

You convert the 3 bytes to a string (you don't say what format they are in now; array, a string, 3 individual wires.) and feed that string to the VISA write.

 

Look in the example finder for examples on the the serial port.

0 Kudos
Message 8 of 9
(5,986 Views)

Hello anybody help me how to use the VISA Read and VISA write commands for controlling the syringe pump  NE-1000

Smiley Happy

0 Kudos
Message 9 of 9
(5,922 Views)