LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to set "VISA Read" as a event source?

I want to made the VISA Read as one of the event source.
For instance,  whenever the "VISA Read" read one byte, it can creat a event, so the event can process it.
How to realize it? Thank you.
 
0 Kudos
Message 1 of 13
(4,082 Views)

Hi

You can use dynamic events. Create a new dynamic event, register it at the event structure and just raise an event if you get data from the serial port.

Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 2 of 13
(4,078 Views)
Thanks,
 
I had tried it ,but unsuccess.
 
I have no ideas of using Creat User Event & VISA Read, they seem to can't connect together.
 
Can you give me more tips.
0 Kudos
Message 3 of 13
(4,073 Views)
Could you post any code? Or maybe a picture of it?
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 4 of 13
(4,071 Views)
Attached  is my code.
Thanks for your help!
 
 
0 Kudos
Message 5 of 13
(4,068 Views)
Here is a possible solution. I'd suggest you to have a look at the LV manual, to get more into it.
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 6 of 13
(4,060 Views)

hi there

please try the attached vi (not testet cause i don't have any serial device at hand).

it uses a string indicator as the data buffer. if there is new data the vi sets the "Val(Sgnl)" - property of the control which itself raises the "value changed" - event. i don't see a possibility to connect user events and VISA. there are the VISA - events (see the VISA advanced palette, but they also can't be connected to a event structure)

 

 

 

Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
Message 7 of 13
(4,061 Views)
Of course there is the possibility to use user events, but for me it just makes sense, if the event needs to be raised from other vis and if I use a state-machine. I know use it really often. For instance if I have to poll for a button to be pressed, I have a vi that polls and raises the event if the button is pressed. I than catch it in the event structure, log some information and enqueue an element into the queue of the state machine, which then retrieves it and executes the corresponding case. The necessary vi to raise an event is the "Generate User Event" vi, which is located in the event palette.
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 8 of 13
(4,056 Views)
Thank you all of you!
0 Kudos
Message 9 of 13
(4,049 Views)
Thanks, all of you!
0 Kudos
Message 10 of 13
(4,049 Views)