Redlion Custom Driver

I've been tasked with controlling 5 cotek power supply's using a redlion graphite HMI. I need to be able to adjust and read the current and voltage setting of each drive.
The cotek supports RS-232 and UART.
Since crimson does not have a prebuilt driver for cotek I'll have to write my own...o_O
I'm assuming I'll need to set the RS-232 port to "Raw Serial" in crimson and use the PortPrint() and PortRead() commands?

From the cotek manual:
Use CR and LF for termination.
To Set Output Voltage Setting
Syntax: SV <value>
Parameter: value -> Voltage value for setting
To set output voltage to 11.95v the command is: SV 11.95 CR LF

Is it as simple as this in crimson?
PortPrint(1, SV MYTAG CR LF)

I've never had to write a driver before so any help is appreciated.
Thanks
 
Is it as simple as this in crimson?
PortPrint(1, SV MYTAG CR LF)

Simple yes but not quite that simple.

Code:
cstring myStr;
myStr := "SV" + DecToText(mytag,0,2,2,0,0) + "\r\n";
PortPrint(1, myStr);
This assumes 'mytag' is a real/float variable. If not the formatting command may need to be different. The backslash characters are needed for CR/LF--this is documented in the manual. Writing characters and strings out the serial port is quite easy; reading them back is a bit more complicated as you are at the mercy of the device on the other end.
 
Simple yes but not quite that simple.

Code:
cstring myStr;
myStr := "SV" + DecToText(mytag,0,2,2,0,0) + "\r\n";
PortPrint(1, myStr);
This assumes 'mytag' is a real/float variable. If not the formatting command may need to be different. The backslash characters are needed for CR/LF--this is documented in the manual. Writing characters and strings out the serial port is quite easy; reading them back is a bit more complicated as you are at the mercy of the device on the other end.

Exactly what I was looking for.
Yes MYTAG would be a real.

Thanks!
 
Just curious, how do you intend to communicate with five devices over RS-232? It's not a multidrop protocol and the Graphite only has two RS232 ports I think.
 
Just curious, how do you intend to communicate with five devices over RS-232? It's not a multidrop protocol and the Graphite only has two RS232 ports I think.

cotek said I could do it using their "CT" cards and assigning an address to each device (see attached image) Then use the ADDS (device addressing command)

Available Command Set
ADDS Device addressing
GLOB Global Power On/Off Control
POWER Power on/off Query
SV Voltage Setting Control
SI Current Setting Control
SV? Voltage Setting Query
SI? Current Setting Query
RV? Voltage Query
RI? Current Query
RT? Temperature Query
REMS Remote on/off Query
STUS Device Status Query
INFO Information Query
RATE? Rate V/I Query
DEVI? Device Name Query
*IDN? Identification Query

CT251.jpg
 

Similar Topics

Does anyone have any recommendations on a software to use to create custom websites for Redlion Touchscreens? Something thats pretty quick and...
4
Replies
2,911
Views
I am getting an error message when I go to upload to the DA70, "un-translated programs in your database". I cannot seem to find or figure out what...
4
Replies
143
Views
Hello, i am currently communicating between a G12 Redlion display and a Altronic DE4000 annunciator over Modbus TCP. When I right to a setpoint in...
1
Replies
223
Views
Hey guys, I’m having an issue with a Red Lion protocol converter. I’m unable to connect to it remotely even though I can successfully ping the...
8
Replies
759
Views
I've had two brand new RedLion CR3000 15" touchscreens go faulty with exactly the same touchscreen fault in 3 months. When it works, the...
1
Replies
319
Views
Top