Hello,
I am an intern at a company and I am trying to get an AB CompactLogix PLC to control a piece of machinery. I need to send checksum values to the controller of the machine that I am trying to control to get it to accept commands. I have the checksum code in C, but it needs to be in Structured Text. I've been working on this for a few days now and I can't seem to get anything that works. Is there anyone that can help?
The checksum function in C is:
int checksum(char*data){
int cs=0;
while(*data!=null){
cs+=*data;
data++;
}
return 255-(cs%256);
}
I am an intern at a company and I am trying to get an AB CompactLogix PLC to control a piece of machinery. I need to send checksum values to the controller of the machine that I am trying to control to get it to accept commands. I have the checksum code in C, but it needs to be in Structured Text. I've been working on this for a few days now and I can't seem to get anything that works. Is there anyone that can help?
The checksum function in C is:
int checksum(char*data){
int cs=0;
while(*data!=null){
cs+=*data;
data++;
}
return 255-(cs%256);
}