Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Input data without hardware

Hi guys,

Im doing a project collecting temperature data through RS232 using serial port. The data is fetch from the port in hex form and will be converted into readable decimal form and also shown in a graph. now the hardware is taken away from me for other purposes and i need to test my VI using my own data.

What should i do to the current VI file?

 

 

0 Kudos
Message 1 of 8
(3,360 Views)

I would use the Diagram Disable Structure to disable the serial port code and put in code (in the new Enabled State of the structure) to simulate the device.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 8
(3,350 Views)

If you have a second serial port, you could also do a loopback and create a VI to write/read from the VI you need to test. The advantage being you would not need to edit the VI you are testing.

0 Kudos
Message 3 of 8
(3,344 Views)

Since the serial port actually feed in the data in hex form , where or how do i create a file consist of my own hex data?should i write the data into a notepad file and read from visa or create command into the current vi?

 Any way, you guys did a great help to me. 

0 Kudos
Message 4 of 8
(3,319 Views)

You can type in hex in notepad and simply read it in as a file. Character by character or line by line if a cr or lf  or both are part of the protocol.

 

greetings from the Netherlands
0 Kudos
Message 5 of 8
(3,305 Views)

if i type the the hex data into the text file and read from the labview, what is the hex format i should use? "0xFF 0x EE" or "0xFFEE" or "FF" "EE"

Do i need to do anything to make it readable?

Some example i found on the web shows "error in" and "error out" in the front panel.why it needs to be there?

 

Im still new to this program and i really hope some kind souls will help me out.

Thanks in advance.

0 Kudos
Message 6 of 8
(3,267 Views)

Guys please help me.Without this i cant proceed to the next step.

0 Kudos
Message 7 of 8
(3,236 Views)

Give this a try.  I recommend typing the hex characters in your file (ex: "FFEEAABBCCDD0123456789").  This little guy will then convert that text into a binary string to be sent to your instrument.

NOTE:  The input string is set to Normal display while the output string is set the Hex display.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 8 of 8
(3,233 Views)