From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

DASYLab

cancel
Showing results for 
Search instead for 
Did you mean: 

rs232 input output

Hi guys,

I'm currently setting up a thermalcycler to DASYlab through a rs232 cable.  I have gotten the input module to work, however, the output module is not being as nice.  My first question I guess is: Can a rs232 input and output module be setup on the same COM port?  I assume they can, but I keep getting an error on the output module when I start the program.

Also, assuming I can get the output module to work, how would I incorporate a global variable into the rs232 output command/string?  Basically I have a bunch of inputs(sliders) where the user can set a temperature they would like to achieve.  The command's format is Temperature xx.x where xx.x is the temperature you would like to set.  What would the string need to be so that xx.x is the value that say global variable 1 is?

 

Thanks,

Chris

0 Kudos
Message 1 of 7
(7,687 Views)

Figured out the COM error issue.  I didnt realize I had already made a output module using COM1, and Dasylab doesn't allow multiple rs232 output modules utilizing the same COM port.

 

Now I'm having a problem with the other issue.  I'm sure it's something simple so hopefully someone will chime in.  I'm thinking I have to make a global string which includes the global variable I input?

 

Thanks 

0 Kudos
Message 2 of 7
(7,680 Views)
0 Kudos
Message 3 of 7
(7,678 Views)

I feel like I'm talking to myself, wish I knew how to edit my posts.

That example CJ posted looks like it can only be used when you have only one global variable in the string.

 

The command I would like to send is:

Step 1,(Global Variable 1),(Global Variable 2),(Global Variable 3)\r

 

Seems like I will have to make a global string instead?

I'm not too familiar with them so any help would be appreciated.

 

Thanks again. 

0 Kudos
Message 4 of 7
(7,675 Views)

You can use the Definition (Extended) mode of the the Global String to combine the elements of the string that you need to send.

 

For example,

 

 

 Step 1,(Global Variable 1),(Global Variable 2),(Global Variable 3)\r

 

would be constructed in ${STR_1} as a formula

 

 "Step 1," + STRFMT(${VAR_1},7,2) + "," + STRFMT(${VAR_2},7,2) + ","  + STRFMT(${VAR_3},7,2) + "\r"

 

i hope that this helps.

 

You can have an input and an output on the same Com port, but you can only have one of each. If you do this, please ensure that the output does not overwhelm the input (sending a string on command is a great way to ensure that the output is periodic), and, account for all response characters on the output. For example, if your device acknowledges the command, you need to tell DASYLab to skip it by including an additional command on the line in the RS232 Output module. You need to use "\#m" where m is a number between 1 and 999 to tell DASYLab to ignore the response characters.

Measurement Computing (MCC) has free technical support. Visit www.mccdaq.com and click on the "Support" tab for all support options, including DASYLab.
0 Kudos
Message 5 of 7
(7,650 Views)

Thanks for the response CJ,

I was able to get the strings figured out.

 

When you say you can only have one input and one output on one COM port do you mean just one input and no slave modules?

 

On my device, I have a string limit of 50 characters.  When I have an output module with 5 channels, each outputting global strings with 40 characters each, activated by the same action module, does DASYlab output all of them at once?  So technically, I'm sending out 200 characters?

 

Is this where I have to use the channel order option? 

0 Kudos
Message 6 of 7
(7,629 Views)

Yes, one input master, and up to 15 slave inputs, but only one output module.

 

On the Action controlled output, you must specify the channel in the Action dialog, so, it only outputs one string.

 

If you have multiple strings, you only need one output channel with the simple [a] in the output parameter, and use different actions to send each different string.

Measurement Computing (MCC) has free technical support. Visit www.mccdaq.com and click on the "Support" tab for all support options, including DASYLab.
0 Kudos
Message 7 of 7
(7,627 Views)