LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Invalid reference error

Solved!
Go to solution

Dear users,

I am using Gwinstek GDP-3303S programmable power supply.
From datasheet , these are the parameters to which i have set the port:
• Baud rate: 9600
• Parity bit: None
• Data bit: 8
• Stop bit: 1
• Data flow control: None

 

I have downloaded the driver for LabView for it, and I have an example VI that I am trying to run.
It runs well the first time, but every consecutive time it fails. I would like to know what I am doing wrong, or have I set something wrong.
Output VI.png
This is the panel for main VI, and it finds the COM3 port, to which the power supply is connected. It also sees it in MAX:
MAX.JPG

What happens when i run it for the second time and on, it fails with error code −1073807346 , and from https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019LPESA2&l=nl-NL I have deducted that it must be related to VISA Session Was Previously Closed  point, since it ran once before and set power supply settings, so it cannot be a missing driver.
In depth it looks like this: 

Write.JPG
It fails here, and what I noticed is that (I think) the VISA resource is not being passed to this block. I think so because "Intf type" returned 0, whereas if I manually set VISA resource in this block and run it, it returns the proper value "4". 
What I have done to try to eliminate this error: I have gone to the "Options" panel and both checked and unchecked "Automatically close VISA sessions", restarted LabView, reconnected USB cable, restarted power supply. All without results. 

Does anyone have an idea what is going on, and why it ran the first time, but not now?

Best regards,

Atizs

0 Kudos
Message 1 of 3
(2,649 Views)

I think you are using the functions provided by the vendor improperly.  This is a VISA instrument, but they seem to be providing the drivers for you.

 

With VISA, you generally do the following:  open the VISA connection with VISA Configure Serial Port, do VISA Reads (or Writes), and finally release the Instrument with a VISA Close.  Presumably the functions provided by the Vendor incorporate these calls -- be sure you are using them correctly.

 

Bob Schor

 

0 Kudos
Message 2 of 3
(2,607 Views)
Solution
Accepted by topic author Atizss

>> It runs well the first time, but every consecutive time it fails.

Definitely COM port is not closed properly. Check If example has VISA close in the last VI and that it executes. Also it is better not to call internal VIs - without the VISA close.

 

Just in case... Do you stop VI by Red Abort button, or by Stop Output program button? Abort will not call VISA close.

Message 3 of 3
(2,591 Views)