CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum by 3S-Smart Software Solutions GmbH | A member of the CODESYS Group
Deutsche Version English version russian version 
It is currently Mon Sep 16, 2019 4:16 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 13 posts ] 
Author Message
PostPosted: Thu Dec 11, 2014 6:12 am 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 3448
Hi,

Using Pi with added Piface with ladder pou's -> example


BR
Edwin


You do not have the required permissions to view the files attached to this post.


Last edited by Edwin Schwellinger on Wed Jan 28, 2015 3:44 am, edited 8 times in total.

Top
   
PostPosted: Tue Dec 16, 2014 12:16 am 
Offline

Joined: Thu Dec 11, 2014 7:48 am
Posts: 6
I have compiled the sample program with ladder logic and logged into the attached Raspberry PI and started the program.

But how do I use the buttons on the PiFace to see that I am able to execute the logic.

Are the PiFace switches and LEDs bound to the variables and elements in the POU automatically or do I need to do some more configuration?

I expect the xSwitch1 will be one of the PiFace switches. Similarly for xSwitch2. But when I press the switches, nothing happens on the PiFace.

The description of the binding of my ladder logic to the PiFace seems incomplete.

If there is something else I can read on this, please advise.

Respectfully

Jim Solderitsch


Top
   
PostPosted: Tue Dec 16, 2014 2:00 am 
Offline

Joined: Thu Dec 11, 2014 7:48 am
Posts: 6
Following up on my question.

Do I need a real circuit, say implemented on a breadboard, that has two real momentary switches and two leds that I connect to the right points on the input and output connections of the PiFace? I can pull power and ground from the PiFace as well

I was expecting to use the switches and leds on the PiFace itself to implement the ladder logic operational logic but I may be confused on what is possible.

Thanks.


Top
   
PostPosted: Tue Dec 16, 2014 6:22 am 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 3448
Hi,

I have added a more detailed example in the first post.
This should show how tp map the piface variables and use WebVisualisation.

BR
Edwin


Top
   
PostPosted: Tue Dec 16, 2014 6:41 pm 
Offline

Joined: Thu Dec 11, 2014 7:48 am
Posts: 6
Yes, this example works like I expected the original one to work. I guess I was right in expecting that the switches in the ladder logic needed to be bound to the variables available on the PiFace. They are no longer part of the declaration section of the POU as they were in the original example.

The visualization works as well except I don't have the background graphic of the PiFace board to provide the image under the visualized switches and leds. Was that graphic meant to be part of the project file? My visualization just shows a white background.

I also like how the ladder also shows the switch boolean values and then the led indicators as you manipulate the switches on the PiFace. And the fourth switch does require a continuous press of 2 seconds before the led lights up because of the timer component on that rail.

Thanks for the quick extension of this example. This will be very beneficial. I want to implement a 2-way traffic light concept in ladder logic and I have an example from a MicroLogic PLC that I want to adapt for this purpose. I think I have enough info now to start this. I will connect the inputs and outputs from the PiFace to a real circuit board where I have green, yellow and red leds as well as actual switches. The timers will give me the ability to automatically progress through a sequence of Green, then Yellow and then Red where the intersecting direction shows the corresponding change from Red to Green.


Top
   
PostPosted: Tue Dec 16, 2014 7:00 pm 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 3448
Hi,
thank's for the feedback. You are right, the image should be embedded into the project.
I've changed it and now it is in the project in the first post.
BR
Edwin


Top
   
PostPosted: Wed Dec 17, 2014 2:09 am 
Offline

Joined: Thu Dec 11, 2014 7:48 am
Posts: 6
I can confirm that the image is now present in the visualization and when viewed from the Codesys IDE it looks good: the HMI items are overlaid on the image just fine. When viewed in a browser (tried Chrome on Mac and PC) the alignment of the HMI elements (switches and leds) is bad. The switches are represented as ovals and are too widely spaced. The Led boxes are bigger than they should be and are not centered properly. Attaching a screenshot.

Not a big deal but curious if anyone else sees the same thing.

Turns out that if I group the HMI elements with the PiFace image, I get a better alignment. Attaching a screenshot from Chrome on Windows. The image still seems unnecessarily elongated -- stretched and the aspect ratio is not respected. When I browse from Safari on my iPhone, I get a weird vertical stretch but at least the buttons and leds remain aligned.


You do not have the required permissions to view the files attached to this post.


Top
   
PostPosted: Wed Dec 17, 2014 9:07 am 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 3448
Hi,

you need to change to fixed client size not best fit.

See screenshot.

BR
Edwin


You do not have the required permissions to view the files attached to this post.


Top
   
PostPosted: Wed Dec 17, 2014 5:51 pm 
Offline

Joined: Thu Dec 11, 2014 7:48 am
Posts: 6
Yes -- that's what I needed. I did not know to open this element of the Visualization UI to find this setting. Once I make the change, then the UI in the browser looks exactly like the UI representation in Codesys.

I am running the English text version of the Codesys UI and I notice that the word for this in my English version is still the German word: Web-Visualisierung and perhaps that can be a point of confusion for new users like me. Almost all of the other words in the UI are translated to English.

I appreciate the timely posts to this forum to my observations.


Top
   
PostPosted: Fri Jan 02, 2015 3:27 pm 
Offline

Joined: Thu Oct 02, 2014 9:56 am
Posts: 9
Hallo,
I'm new on working with, RPi and PiFaceDigital.
So this is very interesting for me. But the projekt PiFaceIoDrv_LadderExample doesn't work on my system! :(
After starting, and updating (it was asked for) there are over 500 errors.
It seems to be that there are missing or bad configured iodriver interfaces, visuelembase, ... .
The GPIOs_A_B is missing too.
What's wrong?

Many thangs
frb


You do not have the required permissions to view the files attached to this post.


Top
   
PostPosted: Fri Jan 02, 2015 5:11 pm 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 3448
Hi,

you need to right click to the raspberry pi device in the device tree,
then update device (to your version)
then set compiler version and visuprofile to current version,
then it should work.

BR
Edwin


Top
   
PostPosted: Mon Jan 05, 2015 3:34 pm 
Offline

Joined: Thu Oct 02, 2014 9:56 am
Posts: 9
Hallo,

I'm sorry, but it doesn't work on his way! posting.php?mode=reply&f=21&t=5989#
Is it because i'm on version 3.5.5.2 and the first error wants to include < Bibliothek SM3_Basic, 3.5.4.0 > and the second <Bibliothek SM3_CNC, 3.5.4.0 >and the third <Bibliothek IoStandard, 3.5.4.0 >???

Excuse me, there is no <update-posibillity> after right-click.
The <compiler version and visuprofile > is updated - Thangs.
But it doesn't work!

BR
frb


You do not have the required permissions to view the files attached to this post.


Top
   
PostPosted: Mon Jan 26, 2015 10:05 am 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 3448
Hi,

Screenshot?
BR
Edwin


You do not have the required permissions to view the files attached to this post.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 13 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited