09-10-2009 12:17 PM - edited 09-10-2009 12:19 PM
Jerry,
I'm working on the same problem too. You think you can post your codes as v8.x instead? We're cheapskates over here
A quick tip from me, when working with these devices. Sometimes if you are getting no signal, make sure you attach a null modem connector.
http://www.zytrax.com/tech/layer_1/cables/tech_rs232.htm
Are you using DB9 or DB25?
Do you know the format of data output the modem is sending? Some modems will send a non-ASCII byte (mono or bi-sync) for synchronization + normal data bytes stream + some trailing bytes. The trailing bytes can be a simple set of all high, i.e. 0xFFFFFFFFFFFFFFFFF. Knowing these will help you synch up.
09-10-2009 03:10 PM
Is ver 9 code not compatible with previous versions? I got this late copy ONLY because it was bought as part of a "green" Government project. I'm active duty Coast Guard and the local Command wants his military housing units to consume at least some solar and wind energy. I got "elected" to do come up with a monitoring program because I made the mistake of admitting that I had some prior experience with programming.
At the moment I've just trying to get the verbose responses to the basic AT modem commands. As mentioned I can take the modem on/off hook, dial, reset, etc so I figure my cabling is OK - and it all works fine when communicating with M/S Hyperterminal.
Sending for example a ath1\r\n will take the modem off hook and return just "ATH1". I get no response to commands that return text - like AT&VI. Sometimes I do get framing errors though - so at least that's something 🙂
09-10-2009 03:27 PM
I think I know what is wrong and why you are not seeing the 'OK'. The response from the modem is multiple lines. You have wired a true to the Enable Termination Character input of the VISA Configure Serial Port. By doing this, you are telling VISA to terminate a read as soon as the termination character is detected. The default termination character is a LF. When the modem sends out the response, I believe there is a blank line before the OK. Assuming that this is correct, your read stops before you see the OK.
It's been so long since I've connected to a modem that I don't remember if there is another termination character that you can use (i.e. '>') but since you won't be using a modem in your actual application, you might not want to worry about that. Most instruments will not respond like a modem. In the meantime, disable ther termination character and do a VISA Bytes at Serial Port and keep reading until the available bytes are 0.
09-10-2009 03:37 PM
I agree with Dennis. You proved you can read to and write from a serial port using LabVIEW with VISA reads and writes. This will be the basis of everything you will do with your application. Of course the serial commands won't be the same - you'll have to consult the equipment manuals - but the way you read and write them will be. Good luck! If you have any questions, ask away. If you don't, it would be cool if you could update us on your progress! 🙂
Bill
09-10-2009 04:01 PM
09-10-2009 04:10 PM
Multiple lines was the trouble. Data was there all along...see the pic.
09-10-2009 04:13 PM - edited 09-10-2009 04:14 PM
Ya-hooey! 🙂
YOU deserve kudos for your persistence.
Bill
09-15-2009 01:31 PM
I'd like to follow up with this a bit if I could....
I'm trying to mod what I have so that an as .exe it'll configure the port on startup - then continuously watch for data that might be available. If I want to input something as a command or query I'd like it to stop - handle that - then once it gets it's response continue watching the port for data.
Curious if someone had time to take a look at the attached .vi. It's admittedly rough at this point - but maybe I can stop and correct my path before I wade too deep in the stupid pool.
As I see it the loop not do a VISA read unless the switch is on. When it's off it'll just do VISA reads.
I'm used to a more event driven enviroment and I think that gets in my way of understanding LV program flow - sometimes.
Thanks -
Jerry
(in Miane where soon it'll be too chilly in the AM to ride the Harley to work)
09-16-2009 02:00 PM
Jerry,
If by "As I see it the loop not do a VISA read unless the switch is on. When it's off it'll just do VISA reads." you meant:
"As I see it the loop will not do a VISA write unless the switch is on. Whatever its state it will do VISA reads." the yes.
You can always try using an event structure if you are more comfortable with event based type programming, although this may just make things more complicated for you.
09-17-2009 05:40 AM
Yep - I screwed up the phrasing.
Note to self: Take meds BEFORE posting from now on.
What I'm trying to do is to only write then the user enters a command and hits Return. The reads will then stop, the write will be performed and after a delay to allow time to respond a read will take place. Once this is done the app will then do constant reads in case the device has something to say that needs to be caught.
I'll get it - just a matter of time. Good thing about staying at it is I pick up a little more LabVIEW familiarization each attempt.
Thanks -