From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

how to make a VI to control servo motor by serial

Hello,

I'm using C++ code to control the servo motor with PIC controller attached by serial with computer.

Now i'd like to change this control program into Labview for future software integration with other controls.

I understand that usually Labview uses VISA to communicate through serial port and looked into some basic examples sending and receiving 'string', that's for 'serial instrument' such as power supply, etc. However, i cannot find appropriate example or i don't understand how to control these kind of PIC controlled servo motor through serial.

Could you let me know what can i do?

Best Regards,
0 Kudos
Message 1 of 2
(2,988 Views)
I guess it depends on what functions are you calling in C++ and what information are you sending the controller. If you are just calling regular serial function and sending bytes or integers instead of strings then you just need to use a Type Cast in LabVIEW. You can wire a regular numeric to a VISA Write by using a Type Cast and you can also Type Cast the string from a VISA Read back to a numeric. You will find the Type Cast under the Advanced->Data Manipulation palette in LabVIEW.

-Josh
0 Kudos
Message 2 of 2
(2,978 Views)