LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

event structure/writing to VISA

I have written som code that is supposed to make it possible for a user to select a string constant and send it to the serial port. It uses the VISA-function and an event structure. It does not work. I include my VI. The "character buffer" is for testing that the event structure actually sends out a string. I haven't actually yet tested the VISA part.
0 Kudos
Message 1 of 10
(3,037 Views)
This program will only write to the serial port once, and that will happend then the while loop ends. Put the write to serial port inside your case structures. Remember also that you only have to use the "visa conf serial port" once.  Also you must brush up on debugging in Labview. These tools are your best friendSmiley Very Happy


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 2 of 10
(3,034 Views)

Hi,

      Could you post your sub vi also.

0 Kudos
Message 3 of 10
(3,032 Views)
0 Kudos
Message 4 of 10
(3,023 Views)
"visa conf serial port"?
0 Kudos
Message 5 of 10
(3,021 Views)
So what you are saying is that I have to move the conversion and the VISA-write into every case of the case structure? It does not sound right... Smiley Sad
0 Kudos
Message 6 of 10
(3,015 Views)

Hi,

 

            you cannot send a data thriugh visa until you stop the while loop so the attached picture may help.Do the small modification to your code and let me know if it works.

Message 7 of 10
(3,014 Views)
I've done as in the picture, putting a VISA-write in every single case. Judging from the character buffer, it only works for case 0.
0 Kudos
Message 8 of 10
(3,002 Views)

Hi,

 

            I am not sure i have understood your previous reply. Is it that case is always 0 if so just run the vi, change the frame ring control which you want to send every time and then press send.  When vi is in run mode if you toggling the ring menu you can see the change in data you want to write in a character buffer indicator provided. Hope this helps you.

 

0 Kudos
Message 9 of 10
(2,998 Views)

What I meant to say was that only when the ring menu was set to case 0 was a string sent to the character buffer.

 

However, I was wrong. By following your suggestions I have created a new charcter buffer for every menu option. It just happened that these was out of bounds for the front panel windowSmiley Wink. So all of them works except that they send messages to different string indicators. While this is annoying, it is not really my crucial problem, as I suppose it will all be allright when I write to the VISA.

0 Kudos
Message 10 of 10
(2,979 Views)