09-24-2013 10:49 AM
Hello all,
Here I have a question about data processing. Now with a UDP open and UDP read vi I keep
receiving UDP messages with different titles (for example $1, $2, $3....) from 2 devices. The 2
devices are almost syncronized and send UDP messages at almost the same time (less than
one second of difference in time). With a Obtain notifier vi I can receive these messages one by
one and send them to another loop. Now what I want to do is to receive these messages TWO
BY TWO! Becasuse they are from 2 devices, firstly two $1 messages, then two $2 messages
and so on. I'd like that the obtain notifier could receive messages two by two, namely the messages
with the same title could be received together! I can't use a concatenate string because the received
messages will accumulate. So what should I do, any idea?
Chao
09-24-2013 10:57 AM
Actually I don't need to combine all messages with all titles two by two, only the message with title $1
because that's the only type of message I'm interested.
09-24-2013 11:04 AM
If you use a common queue instead, both devices can feed the same queue, and then can be dequeued in your other loop.
09-24-2013 11:05 AM
Sure you can use concatenate string. I assume when you say "messages can accumulate", you are talking about storing the string in a shift register. You can also use a select statement to determine when to store the string in a shift register or store an empty string in the shift register.
It is difficult to give any advice without seeing the code that you have now.
09-24-2013 11:06 AM
@RavensFan wrote:
Sure you can use concatenate string. I assume when you say "messages can accumulate", you are talking about storing the string in a shift register. You can also use a select statement to determine when to store the string in a shift register or store an empty string in the shift register.
It is difficult to give any advice without seeing the code that you have now.
Hmmm... your solution is so different than mine. Maybe I misunderstood the question?
09-24-2013 11:18 AM
I agree that you probably really want to use a queue. This way you know you are not overwritting messages. But we really need to see some code to understand properly what you have.
09-24-2013 11:21 AM
Thanks for the reply!
here is a simplied vi of my code. I tried to put a concatenate string at the place
where I put 'here' to do the combination but nothing changed. The Num of message
shows still 2 messages instead of one when 2 messages with title '$ES' come together.
So do you have further suggestion?
09-24-2013 11:23 AM
Sorry my post above with my code is for you. But anyway that's my code and what
I want to say as comments. So any suggestion?
09-24-2013 11:26 AM
Thanks for the suggestion. But as far as I know, the queue function works similar to notifier, right?
And in my code above, do you have any idea how could I use queue and dequeue? Shall they have
the same scheme as the notifier has?
09-24-2013 11:32 AM - edited 09-24-2013 11:34 AM
first of all ...i would get rid of that "stop/abort" vi? and use a local stop control for the second loop and change the control mechanical action to "switch when pressed"