LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to write to custom hardware via serial communication ?

Olli,
i canot run the file u've up....convert byte to string_20070104.vi
i have the 8.0 version Smiley Sad
0 Kudos
Message 21 of 44
(1,329 Views)
Hi
 
Looking at you code there is a protocol you need to follow. I have followed your c code up to checking the status. Lets try this and see how far we get.
 
We need to keep in mind Lynn's warning about the com port being able to function at 300 baud.
 
David
0 Kudos
Message 22 of 44
(1,322 Views)

Can you send commands to the instrument using Measurement and Automation Explorer...

If yes, and it works, then I need more information to help you out... Smiley Indifferent

 

If not, and you aren't familiar with MAX...

Open it up and go through "My System > Devices and Interfaces > Ports (Serial & Parallel) > COM1" and validate the settings on the screen.  Once you are able to open a VISA session, open up the VISA test panel and play around with the write and read operations

(Much like Lynn and David I would suggest you check the baud rate of 300)

Hope this helps.

 

Message Edited by Steve.Briggs on 01-04-2007 12:34 PM

0 Kudos
Message 23 of 44
(1,320 Views)
David,

this is what i get...


Download All
0 Kudos
Message 24 of 44
(1,315 Views)
steve,

no error but no working Hardware either


Download All
0 Kudos
Message 25 of 44
(1,339 Views)
The BFFF0015 error return status you received when reading is a timeout error. 
 
Go to the Property Node operation and drag down to the Timeout Value for the Attribute Name and change the value to something around 2000 to 5000 ms (I think the default new value for the timeout value always sets itself to 0 seconds, so you may have to change it like I said). 
 
If this doesn't work, I'll search in my notes for another solution.
 
Best of luck
0 Kudos
Message 26 of 44
(1,317 Views)
Its responding with the characters that were sent in the program. So thats good news. It tells us that its tx and rx is working OK but why it behaving like that. Is your hardware setup correctly? It looks like to me its in some sort of loopback mode by responding with the bytes that were sent. Maybe that means something to you. Try power cycling your hardware and run the VI again.
 
Now remember the vi I sent only resets and requests status. Nothing else. Does your hardware expected to something when it gets a reset command, an led maybe?
 
David
0 Kudos
Message 27 of 44
(1,316 Views)
Hi,
sorry I forgot you have 8.0.
I attached a picture of the diagram in which I added the "type cast" function David mentioned and the "flatten to string" and you can see how you can concatenate the data and string constants.

Steve,
yes I didn't think about starting  the VISA Test panel in MAX. The  VISA interactive control is always my first choice starting communication with a new device. (they could stop installing the physical buttons and knobs on the front panel of the devices 😉

Ciao
Olli

0 Kudos
Message 28 of 44
(1,312 Views)
0 Kudos
Message 29 of 44
(1,298 Views)
David,
im getting the same result when the hardware shot down Smiley Sad
it is not expecting to something when it gets a reset command, only the right command to operate the receiver .


Steve,
changing to default as u wrote make this results.....(Olli - as u mention...127\n)
i think its ok but what is it mean ?
the hardware still "crouch "




Download All
0 Kudos
Message 30 of 44
(1,290 Views)