05-14-2012 04:16 AM
Hi Good Day,
I created a LabVIEW program that when I wirte a command, it will response to a characters in 1 second span of delay and that response will be read to confirm that it is programmmed. the problem is that I cannot read nor write if I both Write & Read Visa VI are connected each other. But If I ONLY write, It writes. If I use the HyperTerminal with Baud Rate 38400, Data Bits 8, Stop & Parity 0, The command function well & respond easily. I put the Write Visa with String to write _IAPH:43,"",""\r\n and after Write VISA, the Read VISA is inside a While Loop with 50ms time. the Read Buffer String Indicator is the output of the Read VISA.
Hope for your help. Thanks!
05-14-2012 04:40 AM
Here is my sample VI for the test application. The String to write should be _IAPH:43,"JBS251A121800001","D00001"\r\n on the Write Visa and will respond after 1 second. The response will be like this:
JBS251S121800001
D00001
OK
the _IAPH43:,"",""\r\n is a command only to confirm that the string is programmed and the response is the same as above.
The problem is that it will not read the that responses nor write also.
Hope you can help me. Thank you very much
Mugs
05-14-2012 07:42 AM
Well, you started out with a state machine. That's a very good start.
You have several issue with your code.
05-14-2012 09:51 AM
Well, you started out with a state machine. That's a very good start.
You have several issue with your code.
Sir, Thank you for your response & I appreicate it because I am a newbie from LabVIEW application. Hope you understand. Maybe we can focus only on the write-read visa. forget the other case structures because that is for future development.
I already tried to put a Shift registers around the loop and the results are still the same. In the Initialise to Telnet the flow are OK because that GPS not connected is for detection from the Unit.The code for detection is _IAPH:48,0,1 from the firmware & that is why it reads in the Telnet Case eventhough the whileloop on GPS has 50ms time Delay and the the whileloop is waiting for more than 10secs. The \r\n is a code used for terminating the command as our software team procedure says in using other application (like LabVIEW) aside from HyperTerminal and TeraTerm without touching the Keypad and also used for other commands. Without these code, the firmware will not respond once It didnt see these code. The idea of the the command is to write the Serial Number & Unit ID of the Unit and the firmware will respond that the Serial Numbers & Unit ID are programmed and OK.
The 1 second delay is a countermeasure that We might expect just to read the response from the firmware & dedicated only for that command. Yet the problem It cannot write & read while IF I only write it, with the code \r\n, It writes....and when I check to the HyperTerminal the Serial Numbers & Unit ID is written.
The other sequence structure are for future preparation so no problem with that. Hope for your kind help & I would appreciate it.
Best Regards,
Mugs
05-14-2012 10:43 AM
Reread the answer about the \r\n termination characters. You are NOT sending them correctly and if you do not acknowledge that, you will never get your communication to work. Every write is incorrect.
05-14-2012 11:17 AM
@Dennis: Sir I will give you a sample of a \r\n write commands that commands to type a Keypad on a phone. Pleasee see attachment. These write commands are working perfectly fine and used of production already. In all of the commands execution, all have immediate responses in a matter of milliseconds & all command execution will depend only on \r\n.
05-14-2012 11:23 AM
You're just not listening.
I'm going to go somewhere else now.
05-14-2012 12:44 PM
I agree. If you don't like the answer that you are doing something wrong, then stop asking questions here. Since you did not feel it necessary to post actual code, do the comparison yourself of the display type.