LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Eventcallback VI gets called multiple Times - How to Enque Data ?

Solved!
Go to solution

I have a sort of tricky problem i made a 1min Video for:

 

how do i enque data with this instead of having a single value updated each time?

i encountered that sort of a couple of times already on different occassions but im unsure how to name this issue.

0 Kudos
Message 1 of 5
(2,272 Views)

Instead of a video showing static code and a cursor waving around, if you attached the VI and explained (a) what the code did, and (b) what you wanted the code to do, we could probably be helpful.  Plus we'd be able to clearly see your code, modify and test your code, and maybe suggest a fix for your code.

 

Bob Schor


0 Kudos
Message 2 of 5
(2,260 Views)

i recorded this in 1080p but i think you need to set it manually in the lower right corner, otherwise it displays in bandwith dependent quality (= lower). i also explained what the problem is but you need to turn sound on. nevertheless i attached the VI including all relevant files.

 

so the code querrys an web socket server address, which after opening the connection and registering the event, pushes updates back to the client. the client registers this as an event (onMessage) and executes the event-Callback.

 

Problem is that each time it executes it does not enqueue the received data into a queue as intended, but always overwrites the first position in the queue each time the event callback is triggered.

 

the evenCallback fires everytime the server sends new data, so that can be quite often.

0 Kudos
Message 3 of 5
(2,255 Views)
Solution
Accepted by topic author Philipp_Elhaus

You are creating the queue each time. Name it, then you can reuse it.

Certified LabVIEW Architect
Message 4 of 5
(2,249 Views)

100% perfect fix. Thanks a lot!

0 Kudos
Message 5 of 5
(2,245 Views)