Page 1 of 1

Regarding to [Integrate RevPiLib into CODESYS]

Posted: 10 Mar 2021, 05:17
by Wang
Our customer followed the instruction below to build a project,
https://revolution.kunbus.com/tutorials ... einbinden/
and when applied 24 V to input 1 of the DIO, the state of the input is copied to the output and output 1 is switched to “High”.
But when they measure the voltage of output 1, it was always 0. Is this normal and why?
Would you please kindly share the knowledge on how to connect the circuit to light on a led with the output1?
Many thanks in advance.

Re: Regarding to [Integrate RevPiLib into CODESYS]

Posted: 12 Mar 2021, 12:16
by dirk
Hello Wang,
the best thing to do is to have a look at the tutorial "Overview RevPi I/O modules":
https://revolution.kunbus.com/tutorials ... rect=en_US
Check if the power supply at the X2 connector is 24Volt for Output Input.
Check if the LEDs are green: Power, Out and In
You can test the circuit as follows
Grab a multimeter and set it to 24V DC voltage:
Plus: Output Channel 1
Minus: X2 Out GND

Switch the output 1 channel Hi, i.e. as follows:

Code: Select all

piTest -w O_1,1 


Please make sure that no process is accessing the IOs. Disable Codesys and Python scripts.

Re: Regarding to [Integrate RevPiLib into CODESYS]

Posted: 18 Mar 2021, 14:45
by Wang
Hi Dirk,
Thank you very much for your answer.
After we ran your test command, the output voltage turned to 24v.
But when we ran your sample program [Integrate RevPiLib into CODESYS], though the output in codesys is set to 1, the output voltage is nearly 0.
Why this happens and how should we deal with it?
Many thanks in advance!

dirk wrote: 12 Mar 2021, 12:16 Hello Wang,
the best thing to do is to have a look at the tutorial "Overview RevPi I/O modules":
https://revolution.kunbus.com/tutorials ... rect=en_US
Check if the power supply at the X2 connector is 24Volt for Output Input.
Check if the LEDs are green: Power, Out and In
You can test the circuit as follows
Grab a multimeter and set it to 24V DC voltage:
Plus: Output Channel 1
Minus: X2 Out GND

Switch the output 1 channel Hi, i.e. as follows:

Code: Select all

piTest -w O_1,1 


Please make sure that no process is accessing the IOs. Disable Codesys and Python scripts.

Re: Regarding to [Integrate RevPiLib into CODESYS]

Posted: 01 Apr 2021, 16:39
by Amar
Hello Wang,
Tutorials on Integrate RevPiLib into CODESYS are for older library.
https://revolution.kunbus.com/tutorials ... einbinden/

Only download link of new Codesys package is updated on that page as of now.

You shall be using following package from RevPi.Codesys.Lib.zip file
RevolutionPiBridgeV1.0.1.99.package

RevPiCodesysLibHelp.chm help file for this new library will be in default path (asked during package installation)
C:\Users\(Username)\Revolution Pi\Help

When you use this Codesys library then codesys creates a separate config.rsc files and overwrites the pictory configuration.
With this library you should configure the rev pi devices in codesys tree and then check the example Blinking light example.
It may be perhaps that with older tutorials and libary you were writing to wrong offset of DO.When using codesys you should not overwrite config.rsc from pictory.

Send us the SOS report if you have issue after this step as well as your sample codesys project for a test at our side.

Regards,
Amar

Re: Regarding to [Integrate RevPiLib into CODESYS]

Posted: 05 Apr 2021, 10:43
by Wang
Thank you Amar and Dirk,

We have found the root cause to our problem, we forgot to set the execution sequence.
We are so sorry for adding you so much trouble, and hope our experience can help others avoiding similar mistake.

Again, thank you so much for all your helps.
We really appreciated it!
Amar wrote: 01 Apr 2021, 16:39 Hello Wang,
Tutorials on Integrate RevPiLib into CODESYS are for older library.
https://revolution.kunbus.com/tutorials ... einbinden/

Only download link of new Codesys package is updated on that page as of now.

You shall be using following package from RevPi.Codesys.Lib.zip file
RevolutionPiBridgeV1.0.1.99.package

RevPiCodesysLibHelp.chm help file for this new library will be in default path (asked during package installation)
C:\Users\(Username)\Revolution Pi\Help

When you use this Codesys library then codesys creates a separate config.rsc files and overwrites the pictory configuration.
With this library you should configure the rev pi devices in codesys tree and then check the example Blinking light example.
It may be perhaps that with older tutorials and libary you were writing to wrong offset of DO.When using codesys you should not overwrite config.rsc from pictory.

Send us the SOS report if you have issue after this step as well as your sample codesys project for a test at our side.

Regards,
Amar

Re: Regarding to [Integrate RevPiLib into CODESYS]

Posted: 15 Apr 2021, 16:03
by dirk
Hi Wang, never mind thank you for your positive reply.