Hello everyone:
I have been able to read and write data via canopen interface through ADS read and write functional blocks in Twincat PLC control. I have coonected a high voltage power supply and I can read and write value of voltage through it. As you can see in the screen shots that I have been able to scale the value of read voltage.
Now the problem is that I want to write the value of voltage. But I dont know which value I have to write.
Actually I am bit weak at structured text programming. The scaled max=765 and scaled min=0. output max= 52428 and output min=0.
I already tried this code ' wVoltage=(wVolatge)*52428/765;'. But it does not work. wVoltage is a UINT. Please help me so that I am able to scale the value and write the required value. I think it will just work like analog output scaling.
Thanks
Regards
I have been able to read and write data via canopen interface through ADS read and write functional blocks in Twincat PLC control. I have coonected a high voltage power supply and I can read and write value of voltage through it. As you can see in the screen shots that I have been able to scale the value of read voltage.
Now the problem is that I want to write the value of voltage. But I dont know which value I have to write.
Actually I am bit weak at structured text programming. The scaled max=765 and scaled min=0. output max= 52428 and output min=0.
I already tried this code ' wVoltage=(wVolatge)*52428/765;'. But it does not work. wVoltage is a UINT. Please help me so that I am able to scale the value and write the required value. I think it will just work like analog output scaling.
Thanks
Regards