Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

CR800/1000 ComPort adresse


Monte Apr 27, 2010 04:59 PM

hello
I like to use my own constant to open a port for serial comminications. First I tried to use a string constant, but the compiler requested a numeric constant.
Based on the list of alphanumeric com ports for SerialOpen I assume that for Com1 I can use a value of 9.
e.g.
Const Modem_Com=9
SerialOpen (Modem_Com,9600,0,0,10000)

Is this correct?
Does this work for other com ports too (e.g. ComME = 2)?
Does this work for all serial instructions? (SerialIn, SerialOut...)

Thanks for your help
Manuel

* Last updated by: Monte on 4/27/2010 @ 10:59 AM *


thinkitcodeit Apr 28, 2010 01:38 PM

Manuel

If you are defining constants and want to refererence a given port it is much better to use the built-in predefined constants to refer to them. So in your example:

Const Modem_Com = Com1

The following are all predefined constants in CRBasic, a full list can be found in the CRBasic help.

Com1
Com2
Com3
Com4
ComME
ComRS232
ComSDC10
ComSDC11
ComSDC7
ComSDC8

I hope that helps

Simon


Monte Apr 29, 2010 09:44 AM

Yes, this works fine!

Thank you.

Log in or register to post/reply in the forum.