RyanR Posted February 4, 2011 Report Share Posted February 4, 2011 I am trying to control an "Analogue Modules: Laser Flashlamp Controller" through RS232. The attached manual contains the "serial interface specifications" but typing commands in exactly as stated does not produce the desired results. As seen on page 13 of the manual (15 for the pdf) the command format is: $name ##cr I have tried sending my commands in the "Basic Serial Read and Write" vi and in NI MAX by going to the COM port my device is in and clicking "communicate with instrument" and typing commands in the "send string" box and pressing "query". This device is rather dangerous so I have been trying the non operational commands such as reading parameters and changing settings, but never trying to run the device. I have had no luck with either. Two commands I have tried are: $MODE ?cr $MODE 4cr and variations of them: $mode ?cr $mode ?0Dh ...etc... There have been a couple of issues that lead me to believe sending and receiving are happening, but I am just not giving the device commands it understands. For instance: Page 14 of the manual states "AMI" is emitted after start up until the device receives a $. When I turn the device on I receive AMI multiple times in the "read string" of the above stated methods for communicating , but once I type a command (such as the ones above) with a $ as the leading character it stops reading AMI. Another reason is that upon start up, the device displays a caution message until a button is pressed (or apparently a command is sent via RS232) - see the bottom of page 3 in the manual. When I send the first command to the device it has the same effect as pressing a button in that it clears the caution message and brings me to the main menu. 9600 baud, 8 bits, parity=none, and 1 stop bit have been selected as stated in the manual. I am not good with RS232 command protocol, and I have had the issue before that the proper command display format is necessary - e.g "Normal Display", " \ Codes Display", "Password Display", and "Hex Display". Also, I believe sometimes the cr (and other parts) of the "$name ##cr" actually stand for something else (e.g. \n\r) and that is what is suppose to be sent - not the cr itself. Does this sound familiar to anyone? Thanks for any help. Quote Link to comment
ShaunR Posted February 4, 2011 Report Share Posted February 4, 2011 Yup. Sounds very familiar. You have remembered correctly. You have not attached the manual, but. Assuming MODE doesn't stand for something else (like a number) try setting the string control to "\" Codes Display and sending $MODE ?\n Quote Link to comment
crelf Posted February 4, 2011 Report Share Posted February 4, 2011 I think the "cr" in your examples probably mean carriage return, not actually the c and r characters, right? Quote Link to comment
RyanR Posted February 4, 2011 Author Report Share Posted February 4, 2011 Sorry, here's the manual. I tried using the string "$MODE ?\n" which "\ display" format changes to "$MODE\s?\n" and selected the "query" button, but it just reads the same string back to me: "$MODE ?" I tried without the space and got (without the space) the samething "$MODE?" 8800V_Cap_Manual.pdf Quote Link to comment
crossrulz Posted February 4, 2011 Report Share Posted February 4, 2011 according to page 13 (PDF page 15), the cr is a carriage return, aka 0x0D, aka '\r'. Instead of \n (0x0A), you should be using \r Quote Link to comment
ShaunR Posted February 4, 2011 Report Share Posted February 4, 2011 Sorry, here's the manual. I tried using the string "$MODE ?\n" which "\ display" format changes to "$MODE\s?\n" and selected the "query" button, but it just reads the same string back to me: "$MODE ?" I tried without the space and got (without the space) the samething "$MODE?" $SCALE ?\r Quote Link to comment
RyanR Posted February 4, 2011 Author Report Share Posted February 4, 2011 (edited) It seems it was the" \r" I was needing. $BEEP 2\r in "\ display" format (changed to" $BEEP\s2\r") produces two beeps as it should. Thanks all ! Edited February 4, 2011 by RyanR Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.