RevPi Compact & Codesys

Topics about the Software of Revolution Pi
Post Reply
vbezos
Posts: 11
Joined: 07 Feb 2024, 12:41
Answers: 0

RevPi Compact & Codesys

Post by vbezos »

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.
Codesys_1.PNG
Codesys_2.PNG
Am I missing something here?

Thanks in advance
Vaggelis
User avatar
dirk
KUNBUS
Posts: 1948
Joined: 15 Dec 2016, 13:19
Answers: 4

Re: RevPi Compact & Codesys

Post by dirk »

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.
  1. 0V
  2. PE
  3. 0V
  4. 24V
  5. Bridge between Out 0 and In 0
Attachments
chrome_uDmoJMCknW.png
vbezos
Posts: 11
Joined: 07 Feb 2024, 12:41
Answers: 0

Re: RevPi Compact & Codesys

Post by vbezos »

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
User avatar
dirk
KUNBUS
Posts: 1948
Joined: 15 Dec 2016, 13:19
Answers: 4

Re: RevPi Compact & Codesys

Post by dirk »

Hi Vaggelis, it is more or less the same here. Take a look here:
Attachments
RevPi Compact AOUT-AIN (Groß).jpg
vbezos
Posts: 11
Joined: 07 Feb 2024, 12:41
Answers: 0

Re: RevPi Compact & Codesys

Post by vbezos »

Hi dirk

This is exactly what I have done.
Selected photo.png
User avatar
Amar
KUNBUS
Posts: 160
Joined: 15 Jul 2019, 12:58
Answers: 4

Re: RevPi Compact & Codesys

Post by Amar »

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.
Compact 2.png
Compact 1.png
Regards, Amar
KUNBUS
vbezos
Posts: 11
Joined: 07 Feb 2024, 12:41
Answers: 0

Re: RevPi Compact & Codesys

Post by vbezos »

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.
info1.PNG
info2.PNG
Best regards
Vaggelis
User avatar
Amar
KUNBUS
Posts: 160
Joined: 15 Jul 2019, 12:58
Answers: 4

Re: RevPi Compact & Codesys

Post by Amar »

Hi Vaggelis,
It works at my side as shown in screenshots below:
Compact  Test.png
Compact  Test 2.png
Test Project:
CompactTestAI.zip
(268.05 KiB) Downloaded 24 times

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
vbezos
Posts: 11
Joined: 07 Feb 2024, 12:41
Answers: 0

Re: RevPi Compact & Codesys

Post by vbezos »

Hi Amar,

Thanks for the quick response.
I did the following in order:

1) Downloaded your project but again no input as seen below
info3.PNG
2)Stopped Codesys runtime and used PiCtory configuration & piTest and the input was read properly
info4.PNG
3)Started the Codesys runtime with your project and input was read properly.
info5.PNG
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
User avatar
Amar
KUNBUS
Posts: 160
Joined: 15 Jul 2019, 12:58
Answers: 4

Re: RevPi Compact & Codesys

Post by Amar »

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
KUNBUS
Post Reply