LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA Read error durning comunication with ALICAT MB Mass flow meter.

Hi all,

I've an issue with ALICAT MB flow meter. When I'm plugging it into PC and using Flow Vision (Official software), everything works fine. After using LabView codes from ALICAT website (Ver. 2014) I cannot read data from device. I've tried closing / opening communication port, and nothing. Allways freezing at VISA Read. I'm pretty fresh with LabView and I'm not able to solve this alone. I attach a screen from this issue. Thanks in advance. 

 

0 Kudos
Message 1 of 16
(4,984 Views)

Do you have the correct cable?

 

Do you have the correct serial port settings (baud rate, data bits, stop bits, parity)?  I don't see a serial port configure in your VI.

 

Are you sending a termination character with your command assuming one is needed?

0 Kudos
Message 2 of 16
(4,969 Views)

Yes, Previous .vi in which this from screen was placed included serial port setting. The device has no data bits/stop bits/parity config, only its description (for ex A,B,C,D), ,baud rate (19200 is random) an that is all which is similar in device and in my .vi. About termination command, I honestly don't know. It was placed randomly(this software was downloaded from producers page), I couldn't find any manual for this device including LabVIEW, so I just left it here. I have also noticed with other .vi, that numbers of bits sent from VISA Resource Name command is 0, maybe that is the problem, but I don't know how to set up connection properly. There must be some way, because in Flow Vision software everything is working fine, even with COM configuration app which is using cmd communication is fine and cmd prints all measurement values from device. Software was downloaded from here: http://www.alicat.com/support/software-drivers/

 

Thanks in advance for help !

0 Kudos
Message 3 of 16
(4,940 Views)

Why aren't you using the drivers directly?  They look pretty solid to me.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 16
(4,928 Views)

@Moseq wrote:

Yes, Previous .vi in which this from screen was placed included serial port setting. The device has no data bits/stop bits/parity config, only its description (for ex A,B,C,D), ,baud rate (19200 is random) an that is all which is similar in device and in my .vi. About termination command, I honestly don't know.


Do the example programs included with the drivers work? The 'Full Driver Example' looks pretty comprehensive and shows a series of VIs which should be called to set up communications. Of particular note is the 'COM Port Initialization.vi', which sets Termination Character to be true for both Reads and Writes, and to '\r' (the carriage return).

 

@Moseq wrote:

 

I have also noticed with other .vi, that numbers of bits sent from VISA Resource Name command is 0, maybe that is the problem, but I don't know how to set up connection properly. There must be some way, because in Flow Vision software everything is working fine, even with COM configuration app which is using cmd communication is fine and cmd prints all measurement values from device. Software was downloaded from here: http://www.alicat.com/support/software-drivers/

 


Like Billko suggested, it seems likely the driver will work out nicely for you, but assuming that you want to place it in part of your own, larger program, I'd suggest borrowing heavily from the example files provided (in the driver, not in LabVIEW).

 

I don't know if they use a style that you're used to/comfortable with, but it seems likely that for the features you're going to want to use, the examples will show what inputs need which values and so on. Tracing wires backwards will let you know what set those values, and on and on. This should allow you to build your own VI if needed, with a clear guide as to which SubVIs to call in which order.


GCentral
0 Kudos
Message 5 of 16
(4,918 Views)

I used original drivers, every time it times out because of this VISA Read. I've opened NI MAX and tried to test communication. I've tried what u said, so I set termination to true value with carriage return, set everything to default, set baud rates, nothing, every time it times out on read as in the included screen. I'm out of ideas 😞

0 Kudos
Message 6 of 16
(4,902 Views)

Screenshots from MAX are not meaningful in telling whether LabVIEW is programmed correctly.  Especially the screenshot showing a timeout error for *IDN?  I would not expect a mass flow meter to understand that command.

 

You said their software is working fine.  So the question becomes what is their software doing differently from what you are doing.  You can try using software such as a port sniffer, or split the serial cable and feed it into another serial port or another PC and use a terminal program to capture the data stream that happens when their software is communicating with the flow meter successfully.  Then perhaps you'll see something there that explains the secret.

0 Kudos
Message 7 of 16
(4,893 Views)

Well, I did not programme anything, I just used Alicat software. Even standalone LabVIEW application has the same issue, still timing out. Only this Flow Vision app works fine. I don't see any difference with comunication between device and PC, I'm just choosing UnitID = "A", port COM1, not even setting baudrate in Flow Vision app, and it is working fine. I thought NI MAX should give me anything after Read command, without writing anything.

0 Kudos
Message 8 of 16
(4,890 Views)

I don't know why you say you didn't program anything.  You obviously grabbed a subVI in LabVIEW and are trying to work with that in your LabVIEW program.

 

Most devices require a command to be written to it before it will return a response that you can read.  The VI you've shown seems to indicate that as well.

 

Obviously there must be some difference in communication between the device and PC if in one case the Alicat software works, and your LabVIEW program doesn't.   Have you tried using the full fledged LabVIEW example that is in the drivers?  Just grabbing portions of code and subVI's out of an example won't work considering the example had other code to help set up the communication.

 

Have you tried snooping on the communication between the working software and device so you can see the message protocol and then see how it differs from what you are doing?

0 Kudos
Message 9 of 16
(4,880 Views)

Yes , as I wrote before first of all I Have used original labview software. After using diagnostics tool I Have reached this subVI and post an issue. I dont know what commands I should use, there is nothing about it in manual. What tool allows me to snoop What is being sent by any software from and to Device ? I'm new to this stuff, That is Why I came Here 😉

0 Kudos
Message 10 of 16
(4,864 Views)