Can We Change Function Code

S

Thread Starter

srinivasan

Can we change function code for example 01 is for output coil status instead of 01 we can't assign 02 for output coil status maybe it's a ridiculous question but I have a little bit on that source code is only fixed or variable

 
> Can we change function code for example 01 is for output
> coil status instead of 01 we can't assign 02 for output coil
> status maybe it's a ridiculous question but I have a little
> bit on that source code is only fixed or variable

Not sure what you're asking to do, precisely, it sounds like you have master-side code which uses READ COILS and you actually want it to use READ DISCRETES? Or you're implementing slave-side code and you want to report COIL values with the same function code as DISCRETE values?

On the master-side you're likely out of luck - the slave is going to respond to whatever function code it was programmed to use. On the slave-side you can implement your slave so that the COIL and DISCRETE values occupy the same address space. The DAQs and PLCs I design have very small coil and discrete addresses spaces and I report all coil and discrete values using both READ COILS and READ DISCRETES, then validate WRITE COIL and WRITE MULTIPLE COILS requests so that ILLEGAL DATA ADDRESS is returned whenever there is an attempt to write a discrete.

Not sure if I came close to answering your question.
 
Top