LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

C-code to control application through serial (RS232) and LabVIEW

Hi. I am trying to control my external hardware (a camera). A 3rd party software company gave me a modified serial link w/ the functions written onto the hardware, and the commands to communicate with the camera. I am having difficulty sending those commands to the camera and am getting no response from the camera. The commands being sent are simple myCamera(blah) commands and I can't seem to do it using the I/O Assistant. This has been done before in the older versions of LabVIEW w/o the VISA serial vi's.

They have an example code written in c, and I was wondering if it might be easier to just use and integrate that c-code onto LabVIEW (Please tell me how!) or revert back to the older version of ser
ial as I have seen in another posting.

I am not a cs-major, so I don't know how to compile c-code, I only know java. So any help is appreciated!! Thanks!
0 Kudos
Message 1 of 2
(2,909 Views)
I must admit that I've never used the I/O Assistant. I just go ahead and use the lower level VISA functions. It sounds like you might have problems with the configuration of the serial port. It might be a baud rate thing or incorrect termination character. You might want to try some of the VISA serial examples that ship with LabVIEW or convert the Express VI to a standard VI. I'm assuming that you've already tried the commands in something like Hyperterminal and everything is okay there.

To use the C code examples, you'll need a C compiler like MS Visual C and create a DLL (easier than a CIN, imho). If you go to the help menu and select Search the LabVIEW Boookshelf, the pdf file that opens will have a link to "Using External Code in LabVIEW" that wil
l explain how to create the DLL and call it from LabVIEW. However, I think it'll be easier to get the VISA functions to work correctly.
Message 2 of 2
(2,909 Views)