ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Latching a button, and loop issues

Okay, I understand that. Let's say the end of character is /n (I think that's the one for Xbee anyways) how do I let LabView know that this is the end? Is this just something I plug in to the VISA read byte count or is this more complex

 

0 Kudos
Message 11 of 25
(1,426 Views)

You enable the termination character on the serial configure VI.  Then when you do a VISA read, read a large number of bytes, more than you'll ever expect.  The VISA read will terminate automatically when it sees your termination character.

0 Kudos
Message 12 of 25
(1,422 Views)

another option

 

check for EOM.png

Herrlin

Just trying to spread the LabVIEW love.
0 Kudos
Message 13 of 25
(1,415 Views)

Ravens Fan

 

This is for my knowledge.  Would the method work if a serial interface was not being used?  I was thinking no.

 

Regards

Herrlin

Just trying to spread the LabVIEW love.
0 Kudos
Message 14 of 25
(1,410 Views)

Because this device is using arduino to send the strings through Xbee, I changed the print function to println, which automatically adds a termination character at the  end of each string. This worked like a charm! No more slow loops.

 

Now I will have to find out how to get it to process numbers in the case.

0 Kudos
Message 15 of 25
(1,408 Views)

@herrlin wrote:

Ravens Fan

 

This is for my knowledge.  Would the method work if a serial interface was not being used?  I was thinking no.

 

Regards


It probably would.  It depends on the interface.  What other ones did you have in mind?

0 Kudos
Message 16 of 25
(1,395 Views)

USB, GPIB.

Herrlin

Just trying to spread the LabVIEW love.
0 Kudos
Message 17 of 25
(1,393 Views)

@fernian wrote:

Because this device is using arduino to send the strings through Xbee, I changed the print function to println, which automatically adds a termination character at the  end of each string. This worked like a charm! No more slow loops.

 

Now I will have to find out how to get it to process numbers in the case.


What did you end up doing to detect the end of message?

Herrlin

Just trying to spread the LabVIEW love.
0 Kudos
Message 18 of 25
(1,391 Views)

I found you can use in arduino coding println or just adding a \n. Both worked fine for this.

 

My problem now is really redicilous, I really don't know how to solve it. I am realizing I really don't know enough about labview.

 

My read buffer on the VISA is clearly accepting As and Bs that I am sending via an xbee/arduino combo for testing purposes. This setup just sends an A and B string a few times a second. The read buffer sees it and displayed it (in the indicator) but when linked to a case structure it does not select the case, even though in step-by-step mode I can see it output the correct case but not actually change to it. No idea what the issues is here.

 

I've attached a screenshot/vi if anyone can help. Thanks.

 

 

Furthermore, I can receive data extremely fast, but it takes about 10 seconds to send data from this LabView VI to the other Xbee module. The device just turns on a LED, and it works by sending "D" but it takes so long. might be the arduino programming though.

Download All
0 Kudos
Message 19 of 25
(1,385 Views)

It doesn’t appear as though you actually setup the receive to look for a EOM character, whats the deal?

 

Next for your case issues you most likely still have the EOM character in the string you just can’t see it.  Try using trim white space VI before case structure.

 

Lastly have you set up you device to look for a EOM character when you write to it?  I am thinking this because of the “D\n” you have in your sting constant.  If so, I think what you want to do is to right click you string constant and select “’\’ Code Display” and not “Normal Display” then type “D\n”.  As of right now you are sending string D\n not D new line.

Herrlin

Just trying to spread the LabVIEW love.
0 Kudos
Message 20 of 25
(1,373 Views)