Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

How can LabView communicate with PIC (microcontroller)?

Dear all,

I am trying to use LabView to communicate with PIC(16f867A) via serial port. The application is that PIC have to receive one command byte from LabView, and then it will send four data bytes back to LabView. The problem is my PIC is programme to communicate via binary number which is not work for LabView. Can anyone please tell me how can I solve this problem?

many thank,

Noppadon
0 Kudos
Message 1 of 4
(3,458 Views)
Noppadon,

using VISA serial:

open port,
init serial : set baudrate etc, set NO termination character

VISA write with a string control( or constant), right click that control and choose 'HEX display', type the value(s) you want to send. another way is to use an array of byte and use the 'byte array to string' vi. VISA write will send these values to the serial port.

Same with VISA read: you will get a string and with 'string to byte array' you get the byte values

finish with VISA close
Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 2 of 4
(3,449 Views)
PS: I assumed that your PIC has a RS232 interface (MAX232 or something like that) circuit!!
Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 3 of 4
(3,446 Views)
Dear Henrik

Thank you for your suggestion,


Noppadon
0 Kudos
Message 4 of 4
(3,431 Views)