12-12-2016 07:47 AM - edited 12-12-2016 07:49 AM
Hi,
I am trying to send series of commands in decimal format using a RS232 to RS485 converter to a camera that has a zoom control. I have a program that will let me test the commands to the camera to make sure everythings is working proper. I also try sending the comands using the program realterm in decimal format and it also works. But when I try to send the data using Labview I get no results. Here is the code to make the camera zoom in.
255,001,000,032,000,000,033 ( to Zoom in)
255,001,000,000,000,000,001 ( to Stop zoom)
The commands has to be sent in decimal format to the camera. And the photo don't show it but there is a 500ms delay between the Zoom in and stop commands I also try a longer delay.
I attached a photo on how I am sending the comands to the camera. Can anybody tell me what I am missing?
Thanks
JJM
Solved! Go to Solution.
12-12-2016 08:11 AM
Hi
I don't know exactly whta you are missing but anyway some LabVIEW experience in communicating with instruments.
The first thing I would like to see is the string you are writing to the machine and a part of the machines command language.
I expect that between two commands the machine expects a newline (chr(10)) or carriage return (chr(13))
But i'm a bit uncertain about the exact layout.
Can you show a log of what you was sending in realterm?
12-12-2016 08:23 AM
Thanks for your response
I did a screen capture on the setup I use to send the commands to the camera using Realterm. The top command tells it to zoom in and the second line tells the camera to stop. You have to use commas inbetween the data you send. When I send the commands I have to click on the button that says Sends Numbers.
12-12-2016 08:34 AM
Thanks
One possibility is, LabVIEW (or better VISA) is too fast.
I would replace the write VISA with a for loop that writes each character of your string.
Also add your vi instead of a jpg, then I can check better what is going on.
Now I only see part of the code.
Anyway, my first guess is probably false. ( I read what happens in reqalterm)
12-12-2016 09:31 AM - edited 12-12-2016 09:41 AM
Thanks again for your reply
I write a test VI before I add it into my main program. So this Vi is not fancy it's plan and simple. I try the while loop and it still did not worked then I added a delay which still did not work. The Version of Labview I am using is 8.6.1 full development system. My company won't upgrade 😞 . If you look at stack 1 I try the while loop for the zoom in. I put a delay inbetween the Zoom in and stop command. At stack 3 this is the orginal way I had the zoom in stack.
12-12-2016 12:31 PM
Thanks for your help. I figured the problem out it was sample was I realize what the problem was. I had to remove commas. Once I did this I had the control. I include a snap shot of what I did.
Thanks again
JJM
12-12-2016 12:55 PM
Hi
Thanks for the vi.
I have a question, how did you construct the array of bytes that you send?
I took the strings from your first post and they show something else.
Attached 2 vi's one that could work even with 0 ms wait and maybe even without for loop.
the other vi shows the differenc in numbers from translating by LabVIEW and by hand.
12-12-2016 01:16 PM
12-12-2016 02:37 PM - edited 12-12-2016 02:38 PM
What had me confused was that the protocol for the PELCO-D recommends using commas after each unsigned decimal number. Apparently REALTERM removed them when you hit the send number button.