Hi all,
I am doing a project with a PLC, im using sockets to interact with server listening on the PLC.I gave the instructions in the ASCII Format,untill 127 my instructions are working fine,when it exceeds 127 ,the code works but proper values are not sent to the PLC . how to overcome this.
s= 130;
Query = Convert.ToChar(00).ToString() + Convert.ToChar(00).ToString() + Convert.ToChar(00).ToString() + Convert.ToChar(00).ToString() + Convert.ToChar(00).ToString() + Convert.ToChar(06).ToString() + Convert.ToChar(01).ToString(); // Headder Query = Query + Convert.ToChar(06).ToString() + Convert.ToChar(AddrUB).ToString() + Convert.ToChar(AddrLB).ToString() + Convert.ToChar(valueUB).ToString() + Convert.ToChar(s).ToString() ;
after converting it to char s becomes a special symbol,instead of writing 130 in the plc the query write it as 63, whats happening in the conversion,please help me to solve this