CR800/1000 ComPort adresse_Campbellsci论坛问答

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...)

CR800/1000 ComPort adresse_Campbellsci论坛问答

Thanks for your help
Manuel

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

新对话如下:

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

新对话如下:

Yes, this works fine!

Thank you.

分享到:

原文链接:,转发请注明来源!
海洋仪器网 仪器使用 CR800/1000 ComPort adresse_Campbellsci论坛问答
「CR800/1000 ComPort adresse_Campbellsci论坛问答」评论列表

发表评论