@georgedumitru, I believe there's a mistake in the Write command. Instead of using the [CR], it should be the ASCII symbol "\r". My apologies for not thoroughly reading the controller manual. Furthermore, I'm considering putting the switch into an else statement:
long main(void)
{
/* PUT YOUR CODE HERE */
if(hCom<0)
{
hCom = OpenCom(serialdevice,COM_BAUDRATE,COM_PARITY_NONE); //Opening Serial Device
ConnectionStatus=hCom;
}
else
{
switch(status)
{
case 0:
a=Write(hCom,"@00EO\r");
if(a>0){
status=1;
}
break;
case 1:
dataCount = Read(hCom, data,BUFFER_SIZE);
if(dataCount>0){
if(data=="1"){
ResponseFromDMX="ON";
}
else{
ResponseFromDMX="OFF";
}
status = 0;
}
default:
break;
}
}
return 0;
}