LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

send command through serial one at time ???

Solved!
Go to solution

hello every body ...

 

I am trying to send linux commnad to my robot through labview ..

 

i connect it by VISA . bluetooth over USB .

 

i faced 2 poroble .

 

1- it keep send the same command all over the time .

2- timeout problms.

 

 

my VI attached ..

 

please help me bluetooth .JPG

0 Kudos
Message 1 of 18
(5,782 Views)

Hi manesaid,

 

1 - It is like you have programmed it. So it's not a problem, it's a feature…

2 - That could be realted to your "Data bits" property. Why do you read that at all? What's the purpose of reading the "data bits" setting you already know from wiring the VISASerialPortInit?

 

You use the TermChar, atleast you have it configured. If that's the case: get rid of that (wrong) property and use a constant (but sufficient high) number…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 18
(5,773 Views)

thanks GerdW

 

my robot have linux OS .

 

the only way to talk to it using buletooth over USB .

 

the part of  Data bit in you coment i don't get it ...

 

i will explain to you the idea of the VI .

 

first to log to the robot i enter root

 

then to opnen the programme in it Ienter the command

 

the i have list of command i want to do it .

 

the proble i cant control the flow of the data .

 

what is want enter the first command wait for respons and enter the second command on wait for the response .

 

it gust like when you work with terminal or CMD

 

0 Kudos
Message 3 of 18
(5,765 Views)

1.  Use a button and an Event Structure to tell your program when to send the data.

2.  It sounds like your robot is not always sending data back.  Or if it is, it is not more than 8 bytes.  You could use another loop for reading of the serial port.  You may want to take a look at this thread to get some ideas: http://forums.ni.com/t5/LabVIEW/Write-and-read-serial-port-simultaneously/m-p/3106900#M890338


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 18
(5,747 Views)
Tim's Number 1 idea of using the button and an event structure is excellent. Also you might want to use a simple terminal emulator program to send the robot commands just to make sure you understand what it is doing.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 5 of 18
(5,726 Views)

how i can  conect the button with the envent case . what is the proper way to do it

0 Kudos
Message 6 of 18
(5,713 Views)
OK, the first thing you need to do is go through some tutorials to learn about events. NI has several online.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 7 of 18
(5,704 Views)
Solution
Accepted by topic author manesaid

@manesaid wrote:

how i can  conect the button with the envent case . what is the proper way to do it


If you do not know how to use the Event Structure, you definately should go through some of the online tutorials (many of which are free).

3 Hour Introduction
6 Hour Introduction
LabVEW Basics
Self Paced training for students
Self Paced training beginner to advanced, SSP Required
LabVIEW Wiki on Training
Learning NI
Getting Started with NI Products

 

 

But in a nutshell, you simply put down an Event Structure, right click on it and click Add Event Case.  A dialog will open up that will allow you to create a case for the button's value changing.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 8 of 18
(5,673 Views)
Solution
Accepted by topic author manesaid

Also, 'Data bits' is not the correct property node to use here. The data bits property defines the number of bits used for the data (normally 7 or 😎 - it's part of the configuration of the serial port.

 

What you are looking for is 'Bytes at Port' - this tells you the number of bytes in the receive buffer. As others have said though, it is generally better use a termination character if your device is sending one.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 9 of 18
(5,656 Views)

thank you alot bro ... those links are very usful

0 Kudos
Message 10 of 18
(5,626 Views)