Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

How to interface a fuel level sensor on USB/serial port to indicate the level?

Solved!
Go to solution
Solution
Accepted by MGabor

Hi Gabor,

 

Could you give some information about your sensor and USB converter IC? (Vendor, Type, DataSheet)

I think you cannot send and receive data at the same time on 1 wire (1 pair of wire) at the same time neither serial communiation nor USB protocol.

 

Firstly, if you connected your device to USB port, it does not neccessarly follows that you have USB-RAW communication. If you used some serial-USB converter from Dallas and you installed the software for it, you will get serial data on the PC with connectong to the virtual COM port provided by the software. In this case there is a USB encapsulation within a serial data packet.

 

Secondly, you have to use USB-RAW communication when you have a (active) device which has some logic within USB stack implemented. Serial-USB ICs are usually not working in this way.

 

So, could you provide some information about your equipment?

 

Regards,

Peter

Peter Vago
0 Kudos
Message 11 of 19
(1,841 Views)

Sorry for that, but i can give u these infos only tomorrow, because the sensor is not here by me. As soon as i can i ll post the infos. Thank you for your help!
Regards

Gabor M.
CLA
0 Kudos
Message 12 of 19
(1,839 Views)

Hello!
You was right. The equipment is connencted to USB but the PC "see" it as a serial port, named COM1. I executed a serial communication example VI (resource name COM1), but there was no answer in the read string window. What can be the problem?
Thanks for your answer!

Gabor M.
CLA
0 Kudos
Message 13 of 19
(1,829 Views)

Sorry for posting so much, but the equipment is working. I can read out a string for the device, the last question (i hope:) ) is that, the device gives the following string:
\FC\03:DAT1:\s\s\s\s2[mm]\00\04
My question is, how can i indicate the 21st character of this string?

Thank you for the helps!
Regards, Gabor

Gabor M.
CLA
0 Kudos
Message 14 of 19
(1,826 Views)

Everything is done, convertion too, so thank you very much all for your help!
Gabor

Gabor M.
CLA
0 Kudos
Message 15 of 19
(1,823 Views)

Hi Gabor,

 

I just would like to close this topic with the solution, because somebody probably will find our discussion and will be wondering about it.

 

When you executed the serial read VI and you could not see the values, probably you had to set the proper parameters of the serail communication (Baud Rate, Stop bit, Handshake).

For getting the 21st character from a string you can use the String Subset VI, with wiring the constant 20 as offset and constant 1 as length into it. Am I right?

 

If you have further question or information, just post it please.

 

Regards,

Peter

 

Peter Vago
0 Kudos
Message 16 of 19
(1,819 Views)

Yes you are right, with the solution of the problem. Once again thank you for your answers!
Regards

Gabor

Gabor M.
CLA
0 Kudos
Message 17 of 19
(1,816 Views)

I have working sand level sensor. Sensor that is Rechner sensor have a 1.3 m long capacitance probe. Have CAN inside. 8 pins. supply +24 voltage. And I have connected point to point with PCAN-USB adapter from PEAK company. Then connected with my PC. ANd then I installed PCAN-view software. And its not working.?

Thanks a lot

Download All
0 Kudos
Message 18 of 19
(1,694 Views)
The sensor, adapter, and software are not NI products. Why have you hijacked this old thread? You should find a more appropriate forum.
0 Kudos
Message 19 of 19
(1,689 Views)