code examples.
-
- LCD?
- Posts: 9
- Joined: Thu Apr 24, 2003 8:26 am
- Location: Florida
- Contact:
Set Cursor Position **NOT WORKING**
I am having a problem with any command I sent to the LK204-25 that has more than just the CMD_PREFIX CMD format. For example the Set Cursor Position command.
In VB, if I send at 19200 to COM1...
MyComm.Output Chr(254)
MyComm.Output Chr(71)
MyComm.Output Hex(dspColumn)
MyComm.Output Hex(dspLine)
Regardless of the dspColumn and dspLine values, the cursor always positions itself at 1:1
I have tried to send the dspColumn/dspLine as Chr() with the same result. The dspColumn/dspLine values are passed to the function as integers.
Thank you.
In VB, if I send at 19200 to COM1...
MyComm.Output Chr(254)
MyComm.Output Chr(71)
MyComm.Output Hex(dspColumn)
MyComm.Output Hex(dspLine)
Regardless of the dspColumn and dspLine values, the cursor always positions itself at 1:1
I have tried to send the dspColumn/dspLine as Chr() with the same result. The dspColumn/dspLine values are passed to the function as integers.
Thank you.
In the middle of difficulty lies opportunity. - AE
-
- LCD?
- Posts: 9
- Joined: Thu Apr 24, 2003 8:26 am
- Location: Florida
- Contact:
Set Cursor Position **NOT WORKING**
For some reason the addtion of the $ on Chr worked. In debug it seems to produce the same character but I guess in the black box of VB the $ makes a difference. Thank you very much.
Just to be clear....
Use Chr$() instead of Chr() when sending commands via VB.
Just to be clear....
Use Chr$() instead of Chr() when sending commands via VB.
In the middle of difficulty lies opportunity. - AE
-
- LCD?
- Posts: 9
- Joined: Thu Apr 24, 2003 8:26 am
- Location: Florida
- Contact:
Sending Commands
When sending commands to the MO (LK204-25) should I send them one at a time or can I send them as one command? e.g.
In VB,
MyComm.Output Chr$(254)
MyComm.Output Chr$(71)
MyComm.Output Chr$(dspColumn)
MyComm.Output Chr$(dspLine)
-or-
MyComm.Output Chr$(254) & Chr$(71) & Chr$(dspColumn) & Chr$(dspLine)
In VB,
MyComm.Output Chr$(254)
MyComm.Output Chr$(71)
MyComm.Output Chr$(dspColumn)
MyComm.Output Chr$(dspLine)
-or-
MyComm.Output Chr$(254) & Chr$(71) & Chr$(dspColumn) & Chr$(dspLine)
In the middle of difficulty lies opportunity. - AE