Continuously read data from one arduino, and send to another arduino, w/ labview

I am currently working on a project where I read in the sound value from an arduino into labview. I then interpret the signal and based on what it is, I then send an integer to another arduino, in order to have that one send an ir blast to a tv. It is essentially supposed to control the volume of the tv.

I initially had been using one arduino to do both jobs, but when labview sent the signal to the arduino, telling it to adjust the volume, then the continuous stream of sound values that it was sending back, would stop momentarily. And them stopping slowed the system down and it didn’t really work. So I needed to have a continuous stream of data, so I then tried to hook up two arduinos. One to write to labview (the mic level), and one to read from labview (an integer 0, 1, 2, for do nothing, increase volume, decrease volume).

I am having trouble getting labview to use two arduinos.

I understand that labview is not the best way to do this, but I need to use it for the project.

So all in all, I need to find a way for labview to communicate with two arduinos, one for writing, and one for reading.

My arduino write code seams to be working fine. My read code (for reading what do to from labview), might not be correct. Labview sends a integer in the form of a string, then the arduino parseInt()s it and makes it an integer. I then just use a simple == to see what it was, and then either send an ir blast or not. This is a separate problem though. We could try to solve the above problem first. The only possible issue here is reading the string from labview. I know that the sending of an ir blast works.

About the attachments:
The labview file:
So this is a dumbed down version of what I currently have. I deleted a bunch of stuff just so someone else could get the general idea of what I am doing. I currently have two while loops. One for writing to one arduino, and one for reading to one arduino. They were in one originally but that wasn’t working, so I tried two. They can go back into one if that would work better.

So pretty much, the top while loops reads in the volume level, and then based on that will set one of three booleans to true. Either increase volume, decrease, or do nothing. Then one those three case structures will be opened, and then set the value to be sent to the arduino to a single number. (the arduino should be able to read the number and decide to increase or decrease volume).
Then in the bottom while loop, this is to send to the arduino. If that case structure in there is true, it will send whatever the arduinosend value currently is (which was set depending on the top while loop and the outputting volume).

I can’t get them to both work together, the program stops reading in from the one arduino when the second one is hooked up. When only the microphone one is then it will continuously read the value.
I know that I need to only send one signal at a time, and then close the case statement so it doesn’t continuously send the value to the arduino. But for now I just want to know if I am correctly using two arduinos.

The arduino code is also attached. One is uploaded to the microphone arduino, one is uploaded to the ir send arduino.

Any help would be appreciated!

ps, was not able to attach file… so I attached a screenshot. If there is a way to attach a .vi I can do that!

Microphone.ino (523 Bytes)

IR_blaster.ino (1004 Bytes)

Labview Document.pdf (132 KB)

Why does Microphone.ino contain IRsend code?

Why does IR_blaster need to know about the analog pin that the other Arduino uses?

Are you actually using 2 different COM ports in labview? Does it support that?

The arduino sketch had at one point been used to do both things. Now there are two codes, one for the mic, and one for the ir blaster. So some of the stuff just didn't get deleted.

And yes I am trying to use two different com ports in labview. If it does not support that then that could be my problem... I have no idea if it does. That's kind of what I am asking.
Thanks for the reply.

If it does not support that then that could be my problem... I have no idea if it does. That's kind of what I am asking.

You can look at the RX and TX LEDs on the two Arduinos. If the sender's TX doesn't flash when it should be sending data, then it isn't sending data.

If the receiver's RX doesn't flash when it should be receiving data, then it isn't receiving data.

Ok that'll help thanks!
Any idea if there is some error in the arduino sketch, will it then stop everything? Or just ignore it?

Any idea if there is some error in the arduino sketch, will it then stop everything? Or just ignore it?

That would depend on the kind of error, wouldn't it?