Is there a way to assign a ComPort(COM1, COM2, etc) to a variable? I have a program I'd like to use on multiple dataloggers, but the device I'm connecting to may not be on the same ComPort. Instead of doing a search/replace changing Com1 to Com2 whereever it's needed, I'd like to only change it at the top of the program.
I tried something like:
Dim wxtCom = Com1
but I got a compile error.on SerialOpen(wxtCom,....)
Am I asking too much?
You can use a constant for the comport number in SerialOpen.
Const wxtCom = Com1
All the other serial instructions can use either a constant or a variable.
Dug around the help a little more and discovered Const.
Const wxtCom=Com1
works just fine. If there's a better way, please reply.
Thanks. I should have just waited one more minute!
You might find `ConstTable` useful as well.