RevPi Compact & Codesys
Hi All,
I am using a RevPi Compact with Codesys runtime.
I managed to run properly RS485 comms and Digital Input/Output, but when it comes to Analog Inputs I cannot take a reading.
I tried to wire Analog Output to Analog Input for a quick test but even with 2V measured with the multimeter both at the output and input terminal I do not get any value inside Codesys. Am I missing something here?
Thanks in advance
Vaggelis
I am using a RevPi Compact with Codesys runtime.
I managed to run properly RS485 comms and Digital Input/Output, but when it comes to Analog Inputs I cannot take a reading.
I tried to wire Analog Output to Analog Input for a quick test but even with 2V measured with the multimeter both at the output and input terminal I do not get any value inside Codesys. Am I missing something here?
Thanks in advance
Vaggelis
Hi vbezos, Perhaps you have connected an output to an input using a piece of wire.
Unfortunately, this is not enough because he inputs and outputs are electrically isolated.
You also need to connect 0V 24V for the inputs and outputs in general.
Unfortunately, this is not enough because he inputs and outputs are electrically isolated.
You also need to connect 0V 24V for the inputs and outputs in general.
- 0V
- PE
- 0V
- 24V
- Bridge between Out 0 and In 0
Hi dirk
I know, that's the way I have connected DIOs but above I was referring to Analog Inputs.
Any recommendation on these?
Best regards
Vaggelis
I know, that's the way I have connected DIOs but above I was referring to Analog Inputs.
Any recommendation on these?
Best regards
Vaggelis
Hi Vaggelis, it is more or less the same here. Take a look here:
Hi dirk
This is exactly what I have done.
This is exactly what I have done.
The previous picture shows wiring to Analog input CH 6.
Also, the input variable declared in CODESYS should be called in program in order to be updated cyclically.This can be done as shown in screenshots below.
Regards, Amar
Also, the input variable declared in CODESYS should be called in program in order to be updated cyclically.This can be done as shown in screenshots below.
Regards, Amar
KUNBUS
Hi Amar,
Analog Input terminal 6 on RevPi Compact(0-7) corresponds to AI_Ch7 inside Codesys(1-8).
Also the variables mapped at these channels are read inside the program, as you can see below DIs are read correctly and the problem remains in AIs. Best regards
Vaggelis
Analog Input terminal 6 on RevPi Compact(0-7) corresponds to AI_Ch7 inside Codesys(1-8).
Also the variables mapped at these channels are read inside the program, as you can see below DIs are read correctly and the problem remains in AIs. Best regards
Vaggelis
Hi Vaggelis,
It works at my side as shown in screenshots below: Test Project:
Attached project is tested with:
revolutionpibridge-V1.4.1.0
CODESYS Control for Raspberry PI 4.10.0.0
You can try other Analog inputs.
Test if Analog inputs can be read without CODESYS
-Uninstall CODESYS control on Compact
-Configure Compact through piCtory. Save pictory configuration and reset driver.
- Use piTest to write Analog output and read analog input channel
Other remaining possibility would then be damaged Analog Inputs.
Regards, Amar
It works at my side as shown in screenshots below: Test Project:
Attached project is tested with:
revolutionpibridge-V1.4.1.0
CODESYS Control for Raspberry PI 4.10.0.0
You can try other Analog inputs.
Test if Analog inputs can be read without CODESYS
-Uninstall CODESYS control on Compact
-Configure Compact through piCtory. Save pictory configuration and reset driver.
- Use piTest to write Analog output and read analog input channel
Other remaining possibility would then be damaged Analog Inputs.
Regards, Amar
KUNBUS
Hi Amar,
Thanks for the quick response.
I did the following in order:
1) Downloaded your project but again no input as seen below 2)Stopped Codesys runtime and used PiCtory configuration & piTest and the input was read properly 3)Started the Codesys runtime with your project and input was read properly. Should the Analog input mode be configured in PiCtory even if I use Codesys?
Cause this is the only change made during this sequence.
PS. I reverted PiCtory Analog Inputs modes to off as by default and the input was not read inside Codesys.
Best regards
Vaggelis
Thanks for the quick response.
I did the following in order:
1) Downloaded your project but again no input as seen below 2)Stopped Codesys runtime and used PiCtory configuration & piTest and the input was read properly 3)Started the Codesys runtime with your project and input was read properly. Should the Analog input mode be configured in PiCtory even if I use Codesys?
Cause this is the only change made during this sequence.
PS. I reverted PiCtory Analog Inputs modes to off as by default and the input was not read inside Codesys.
Best regards
Vaggelis
Analog Input channel should be configured to 0-10V in CODESYS Compact Parameters as in your test case.
Codesys Configuration overwrites pictory configuration.Pictory configuration is independent and not used together with codesys.
The combination with pictory and piTest was an alternate option suggested only to cross check if analog inputs are working correctly independent of CODESYS.
You can notice after reboot the /var/www/revpi/pictory/projects/_config.rsc being generated and overwritten by downloaded CODESYS application.
Also the PlaceholderFilePath in /etc/CODESYSControl_User.cfg should be configured correctly as mentioned in release notes.
For CODESYS Control for Raspberry Pi MC SL - 4.10.0.0
[SysFile]
PlaceholderFilePath.2=/etc/revpi, $configrsc$
Reboot after configuring PlaceholderFilePath.
Regards, Amar
Codesys Configuration overwrites pictory configuration.Pictory configuration is independent and not used together with codesys.
The combination with pictory and piTest was an alternate option suggested only to cross check if analog inputs are working correctly independent of CODESYS.
You can notice after reboot the /var/www/revpi/pictory/projects/_config.rsc being generated and overwritten by downloaded CODESYS application.
Also the PlaceholderFilePath in /etc/CODESYSControl_User.cfg should be configured correctly as mentioned in release notes.
For CODESYS Control for Raspberry Pi MC SL - 4.10.0.0
[SysFile]
PlaceholderFilePath.2=/etc/revpi, $configrsc$
Reboot after configuring PlaceholderFilePath.
Regards, Amar
KUNBUS