06-18-2018 06:52 AM
Hi, I try to read data from a simple multimeter with USB interface. When I use the Instrument assistant the data gets correctly displayed during the 'read and parse' step (see attached screenshot 1), but neither the finished VI created by the assistant nor the visa test panel succeeds to read the data (screenshots attached). The error is always: "The resource is valid, but VISA cannot surrently access it." (Even though NI-trace shows a viClose as last command of the assistant.)
Could someone please help me? The multimeter has a very simple serial interface: it does not 'listen' to anything. It just sends the data 2 times per A/D cycle to the serial interface as soon as the function is hardware activated. I use a FI2803MT, but, if I understood well, many other multimeters send their data the same way. I did not suceed to mimick the instr assisant commands to get the data.
Thanks a lot for your help
Solved! Go to Solution.
06-18-2018 09:24 AM - edited 06-18-2018 09:24 AM
It seems to me that your serial port was not closed out from using the Instrument Assistant. Close out of LabVIEW and MAX. Then try MAX again.
From what I was able to gather, your VI should look something more like this. Notice the serial port is being configured before the loop and closed after the loop. Then the parsing is simple with the String To Byte Array combined with an Index Array to get most of the parameters along with a String Subset function to get the digits.

06-18-2018 10:27 AM
Hello and thank you for the reply.
I hoped to make something like the vi you sent, but the famous error appears at the 'Visa configure serial port.vi' at the very beginning. Could you please describe in more detail what you mean with "Close out of LabVIEW and MAX"
(Some guesswork:
1. Run the visa close.vi (the last one in your vi).
2. Close LabView and MAX and open again.
3. Close LabView, close COM5 in MAX and close MAX.)
Il will try these possibilities tomorrow and come back to you.
06-18-2018 10:49 AM
@Bully wrote: Could you please describe in more detail what you mean with "Close out of LabVIEW and MAX"
I simply meant to close LabVIEW and MAX. This should release any resources they may be holding on to for whatever reason. If you want to be thorough, you could also reboot your machine. I then suggest trying to get the commands to work in MAX.
06-19-2018 06:46 AM
Hello,
Thank you for your help. It works now in MAX and also in LV.
A thing that might have helped to make it work in MAX was to set 'flow control' to none (before it was on RTS/RTC (or something like that)).
And thank you also for the ideas in the VI screenshot (byte array).
A little follow up question: Is there a simple means to extract the state of a specific bit from a byte value? (I wrote a work-arund with a loop, dividing by 2^x and checking if the result is integer... but I believe there is a better means that I did not find.)
To close the forum topic, I will check your post with the vi screen capture as solution, but I don't know what kudos are nor if or how I can distribute them. So if you have time to educate me a bit you're welcome. Thanks again and best regards.
06-19-2018 07:55 AM - edited 06-19-2018 07:57 AM
@Bully wrote:
A little follow up question: Is there a simple means to extract the state of a specific bit from a byte value? (I wrote a work-arund with a loop, dividing by 2^x and checking if the result is integer... but I believe there is a better means that I did not find.)
No loop required. You can just AND with a mask and use Not Equal To Zero to get the bit's value.

06-19-2018 09:36 AM
Yes, that's more elegant than what I did. (Never used Masks before) Thank's again.