You have sufficient information now to answer it yourself!
This is standard, basic, textbook ‘C’ stuff - there is no magic, and nothing special or peculiar to OPen-AT:
char comando[]="OPEN<LF><CR>";
That is just a standard ‘C’ string, isn’t it?
It contains the word “OPEN”, followed by a less-than symbol, etc.
There is nothing special or peculiar to Open-AT here.
char comando[]="OPEN\n";
Again, that is just a standard ‘C’ string, isn’t it?
It contains the word “OPEN”, followed by the standard ‘C’ \n escape sequence.
The only possible dependency on Open-AT is whether the \n might get translated - and I have already answered that question!
snoke
Any way your write/send it, to send the same than an “Enter” to a PC: Usually in Windows you need \n\r, and in Linux \n is enough.
Anyway, it depends on what you mean with “station” and the reciving program on it.
Windows requires CRLF as the end-of-line sequence; that’s why some ‘C’ compilers will translate \n in a ‘C’ string to CRLF in the actual output stream (strictly, it’s the runtime library that does the translation - not the compiler).
I have already noted that adl_fcmSendData does not do any translation (which is obvious, if you think about it - otherwies it could not be used for binary data!)
Note that there is no direct relationship between the ‘Enter’ key on a PC keyboard and any sequence of characters that may or may not be transmitted on the PC’s COM port!
It depends entirely upon the application.
eg, Hypoterninal can be configured to send either CR or CRLF when the ‘Enter’ key is pressed…
That depends entirely upon the “station” and has nothing at all to do with Open-AT.
Your Open-AT application must do whatever the “station” requires.
To find out what the “station” requires, you must study its documentation and/or speak to the manuafacturer.
However, at a guess, I would say that the “X100>” looks very much like a prompt, doesn’t it?
And the reason for any system to give a prompt is to indicate when it is ready to receive, isn’t it?
Therefore you should assume that, before the prompt, the “station” is not ready to receive - don’t you think?
Do not guess - consult the documentation for the “station”.
If the documentation is not clear, then ask the manufacturer of the “station”.
And have you verified that this is the correct command?
And that you are sending it at the correct speed, with the correct serial port settings, using a correctly-wired cable with all the correct handshaking lines, etc…
Yes OPEN only open de system, if i need get data i need send SHOW DATA. And \n is correct.
i think the cable is correct, because when i connected directly to station with PC and hyperterminal, work correctly, but i have a question, is a necessary config in my app the settings of port? The speed i config with hyperterminal and i set at&w to save, but how i can config data bits, party, stop bits and flow control?
Do you have an oscilloscope?
If not, use the Rx line of a PC's COM port...
I will try!
No the cable not same, but the strange is when the modem is connected with serial cable to station and i execute one call data with hyperterminal to this modem and i put “OPEN + enter and SHOW DATA + enter” the station return a good data…
But i just want to have one modem to execute this process (get data)…
And if the same modem gets data when i calll data to it and i put the commands to get data… is strange why it doesnt get data when i run my app…
If i type only “OPEN” nothing happens, i need press the enter for receive:
APPLICATION MODE STARTED
X100>
Yes i configured manually before starting the app.
I think the most likely cause is that your application is not sending the correct command termination character(s) - especially as you still haven’t confirmed that you really understand precisely what the correct command termination character (or characters) is (or are).
[size=150]You really need to confirm this explicitly from the “station” documentaion[/size] - or, failing that, by a specific enquiry to the manufacturer.
Another possibility is a timing issue - but you really need to confirm the command format first.
You are supposing the incoming data is ASCII, this probably is right if you comunicate with it via terminal. But suppose the length of the data is only 1, probably wrong.
And much important, THE INCOMING DATA IS NOT A STRING, you must convert it adding \0 at the end of the incoming data.
Review your C knowledge about strings, you will find more problems like this while you work through a terminal.
In C, a string is always a char array finished with a \0 (0 in ascii). FCM data handler works with ascii and no-ascii strings, so what you need are waiting in you code is something like: [‘H’, ‘E’, ‘L’, ‘L’, ‘O’, ’ ', ‘W’, ‘O’, ‘R’, ‘L’, ‘D’, ‘\n’, ‘\0’]. Your station terminal doesn’t send you the ‘\0’. If you want to use the FCM incoming data as a string, you must add manually the \0.
In your own benefit: review your C knowledge about strings.