12-04-2014 09:33 PM
Hi Everyone,
I am a relatively new labview programmer, so please bear with me if any of my questions are simple.
Basically I have a project which has multiple different IO sources with an overall top level control and display program.
To start with, I am writing a driver for a GPS device. The GPS driver reads in strings from the COM port, and then passes them to the GPSParserBuffer, which converts each of the possible strings and puts it into a cluster.
What i would then like is for an event to be generated whenever a new string comes in.
This event will then be passed to a GPS display VI, which will listen to the events, and display only a portion of the information to the User.
at present, the driver and buffer work correctly - i can run my code and the GPS cluster fills correctly.
What I am struggling with is passing this event to the GPS Display vi. The generated event never seems to make it out of the parserbuffer, and hence the GPS display never gets triggered.
I have adapted this from another GPS driver i have seen which works in this way, but i cant seem to get mine to work.
Thanks in advance
Ben
Top Level tester VI - GPS.vi runs and fills GPS cluster
GPS.vi initialise case
GPS.vi read case. Probe "28" and "30" contain the event number, but Probe "32" does NOT - i suspect this is my problem but im not sure what the issue is.
GPSparserbuffer.vi - initialise case where the event gets generated
parserbuffer run case - an event is generated every time the GPS cluster is updated
GPS Display code - register for a data event and put select values from GPS cluster into the GPS Monitor indicator.
12-04-2014 10:51 PM
If I want to generate event from sub VI what I do is...
1) Create value change event case associate with any boolean(Say trigger).
2) Pass boolean reference to subVI.
3) Generate event using value signaling property node.
4) In your case you can check for new string and generate event using value signaling property node.
Check attached VI
12-04-2014 11:31 PM
Thanks, ill give that a try and get back to you.
12-04-2014 11:41 PM
thinking about it more, this will suit my needs very well - I could also modify the code so that I can include update rates on certain controls too - for instance, someone might set the GPS to send 10 messages per second, which for my application might be too much, so I could also set it to just update the front panel once every two seconds if I need, AND also keep the timeout case in the event structure for data dropouts.
once I finish changing the code I will repost some screen captures.
12-05-2014 12:26 AM
Good check and let me know.
Give KUDOS or marked as solution to post if it has solved your problem. 🙂
12-10-2014 12:12 AM
I ended up sticking with the User event generation - the actual issue was that I had a global functional variable (GPS.vi) that didn't exit on the read case, and so it would get stuck in there and therefore not pass the event generation (or the other data) up to the top level vi to be actioned.
Thanks for your help