LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Bluetooth woes...

Solved!
Go to solution

Put the VISA reference wire on a shift register.

 

The serial port is only determined when the VI is first run.  If you don't start the device until later, I imagine the VISA port doesn't exist.  So what VISA port is being used in that case?  None?  Something else?

 

Try a case structure inside the loop that runs when you want to reinitialize.  Put the VISA Port and Serial Configure in that case structure.

Message 11 of 14
(668 Views)

@RavensFan wrote:

Put the VISA reference wire on a shift register.

 

The serial port is only determined when the VI is first run.  If you don't start the device until later, I imagine the VISA port doesn't exist.  So what VISA port is being used in that case?  None?  Something else?

 

Try a case structure inside the loop that runs when you want to reinitialize.  Put the VISA Port and Serial Configure in that case structure.


Like this ? Checked and this seems to work … any further refinements to this need be done ? 

BT Serial AutoReconnect.png

Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 12 of 14
(664 Views)

@MogaRaghu wrote:

@RavensFan wrote:

Put the VISA reference wire on a shift register.

 

The serial port is only determined when the VI is first run.  If you don't start the device until later, I imagine the VISA port doesn't exist.  So what VISA port is being used in that case?  None?  Something else?

 

Try a case structure inside the loop that runs when you want to reinitialize.  Put the VISA Port and Serial Configure in that case structure.


Like this ? Checked and this seems to work … any further refinements to this need be done ? 

BT Serial AutoReconnect.png


Just a couple of comments:

  1. That "Write Command (Loop)" button with the Case structure is a pure Rube Goldberg construct. You do not need the Case structure. Beside, you should use the "Latch until released" mechanical action for the "Write Command (Single)" button, so you do not need to switch it back via a Local Variable!
  2. So actually that 5 msec Wait and the Local Variable in the Sequence Structure is not needed, delete the whole Sequence frame! If you use a proper termination character for communication, the VISA Read will wait until a msg comes in with a termination character, or until it reaches the configured timeout. If Timeout happens, handle the error as you need to!
Message 13 of 14
(656 Views)

Thanks @Blokk. Valid points. 

 

About the Rube Goldberg ( whoever it is !) :  Initially I had a construct to write the SEND command once in every multiple time delays to try out various scenarios. Finally I found that 100ms is optimum but forgot to remove the Case !! 

 

After the refinements the VI looks simple ( and efficient ) 

Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 14 of 14
(640 Views)