10-23-2009 06:55 AM
I can send only one String when the program has started.
After that the port remains open, but Dasylab does not send the following string.
I used a comportmonitor to see what happens. Dasylab closes and then reopens the port to send the first string.
The serial output in Dasylab is configured as follows:
- No control input
- Single command
- Output format: [a]\r
What could be the reason ?
Regards
Andreas
Solved! Go to Solution.
10-23-2009 06:57 AM
Did you use an action list to trigger the send command?
Tom
10-26-2009 07:19 AM
As Tom has surmised, you have configured the RS232 Output module to send a string or variable using an Action module.
How do you have the Action module configured?
You can zip your worksheet and post it, and let us look at it.
RS232 devices are extremely varied. If you have information about the device, including a manual, it would be helpful.
10-26-2009 08:57 AM
Yes the RS232-output is triggered by an action module.
Within the action-module I use "Send a global String". There are no more parameters to configure.
In the meantime I figured out, how to get this program to work.
I had to set an additional switch in "options" of the rs-master-module. (See attached jpeg)
At my comportmonitor I can see that serial interface is periodically closed and opened.
But this seems to be only a workaround.
Each string I send is always 'the first string', because the comport was opened before.
Why can't I leave the port open ?
Regards
Andreas
10-26-2009 09:34 AM
Andreas.. you didn't mention that you also have an RS232 Input.
There is sometimes a problem between RS232 Output and Input if the device responds to the output and the input doesn't account for it.
The RS232 Output command can include an additional parameter \#n, where n is the number of characters to ignore.
For example, if my device responds
OK<CR<LF> to the command, I would have a string that looks like this:
[a]\r\#4
So that the OK is ignored and completely accounted for before the RS232 Input module does the next measurement request command.
To help more, it would be useful to know the device and the commands, and how often you are doing an input or an output.
10-26-2009 10:10 AM
The device is a pcb we want to test in our production line. Therefore I send ascii-strings to the device.
The device answers always with a string of a constant length which has the following format:
>xxxxx;xxxxx;xxxxx;xxxxx;xxxxx;CR
The first character '>' is used as start-character to recognize the beginning of the string.
The'xxxx' are five substrings which holds the received parameters and are saved in separate global strings.
So the Output-command is: [a]\r
In the Receive-module I use 6 channels:
1. ">" 5a $01
2. 1x 5a $02
3. 1x 5a $03
4. 1x 5a $04
5. 1x 5a $05
6. 1x 5a $06
This works..... but only one time.
( It would be no problem to send the whole dasylab-program, but it is very complex.
I tried to structure it, but there are only limited possibilities in Dasylab to comment a program)
10-26-2009 10:24 AM
The received string has ouf course six values not five.
>xxxxx;xxxxx;xxxxx;xxxxx;xxxxx;xxxxxCR
Sorry.
10-26-2009 10:44 AM
How do you control the Action? Do you have a TTL Pulse Generator?
Usually, when you have a straightforward Data Request command, you use only the RS232 Input configured to send the request, and then process the response, as you have done. Is there a reason that you are using both an Input and an Output module?
You configure the RS232 Input to have a Data Request command in the Options dialog... the Datenanforderung notwendig setting would be set to Ja.
That opens a new setting on the main dialog box where you can enter the command.
My initial thought was that you need to use one of the Handshake settings... there are three that start with "Without" that configure the port to hold the Receive / Transmit control pins high or low. if you try each one in turn, to see if one works?
10-26-2009 11:07 AM
All action-modules are triggered by a global variable, which is used as an index
to make sure that the actions are triggered in the right order.
This index is incremented by the program and sometimes by pressing a program button.
It seems that I didn't understand the function of the RS232 module properly.
Yes, I use the output-module is for sending strings and the master-module to receive strings.
I didn't know, that I can use the master-module also for sending commands.
I will try this method.
Regards
Andreas
10-27-2009 05:05 AM
I tested the method using only the input moule.
The input module only accepts constant strings as data request. It is not possible to use a global string ( [a]\r ) .
This is only available within the output module.
In my case I have different request commands depending on the function of the external device.
So I would need separate slave input modules for each command.
How many slave modules are possible ?
I have about 20 commands.