OK so I am having problems with the visualization feature in CODESYS. I have created an application and it is working nicely on my PiFace with physical keys (PiFace.byIn.0 in this case). But when I try to make a visualization of the key to access it online it does not work. I create the key and give it the variable PiFace.byIn.0. In simulation mode the visualization works fine. When I press the key the ladder diagram starts, but when I upload the application to the RPi the key does nothing. I can access it over the IP adress and press it, it even functions in the visualization but it does not start the application.
I want the virtual key that I press over the web server (or at least in the visualization window of CODESYS) to actually start the application in a way as if I would physicaly press the key on my PiFace. How do I make it work? Why is it not working correctly? Am I missing something?
I am also uploading the video later today, so you can see the key working in simulation but not on RPi.
P.S.: the app is working fine if I press the phisical key on PiFace.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
you need to have an own variable for the xVisuswitch because otherwise the real input from Piface overwrite your value if you use by.in
in your visu. This is the reason why it works in Simulation - the real Input is disconnected in simu.
You need to add a 'or' in your ladder (or in which language ever you are setting your output) and set the Output either from the real Input (PiFace.byIn.0 in my screenshot it is xSwitch1) of PiFace or thr virtual Input (xVisuswitch ) from the visualisation
Hi Edwin! Thank you very much, this clears up everything I thought that you can only visualize physical keys and not the other way around Another question then. I can access the website from my computer, but not from my phone. This is probably because the RPi and my computer are on the same router, and the phone isn't connected to it. Is there any way to make this page accessible to anyone?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi! I have forwarded the port for the IP of my raspberry, but I am still unable to connect to webvisu.htm if I am not on the same network. Just to clear things up, I can connect to the page if I am on the same WiFi network with my phone, but when I use my mobile data, the page is unavailable. I'm starting to think that there is no way to make this page available to everyone, let's say you reading this
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi!
OK so I am having problems with the visualization feature in CODESYS. I have created an application and it is working nicely on my PiFace with physical keys (PiFace.byIn.0 in this case). But when I try to make a visualization of the key to access it online it does not work. I create the key and give it the variable PiFace.byIn.0. In simulation mode the visualization works fine. When I press the key the ladder diagram starts, but when I upload the application to the RPi the key does nothing. I can access it over the IP adress and press it, it even functions in the visualization but it does not start the application.
I want the virtual key that I press over the web server (or at least in the visualization window of CODESYS) to actually start the application in a way as if I would physicaly press the key on my PiFace. How do I make it work? Why is it not working correctly? Am I missing something?
I am also uploading the video later today, so you can see the key working in simulation but not on RPi.
P.S.: the app is working fine if I press the phisical key on PiFace.
Hi,
you need to have an own variable for the xVisuswitch because otherwise the real input from Piface overwrite your value if you use by.in
in your visu. This is the reason why it works in Simulation - the real Input is disconnected in simu.
You need to add a 'or' in your ladder (or in which language ever you are setting your output) and set the Output either from the real Input (PiFace.byIn.0 in my screenshot it is xSwitch1) of PiFace or thr virtual Input (xVisuswitch ) from the visualisation
BR
Edwin
PiFaceIoDrv_LadderExample.project [105.94 KiB]
Hi Edwin! Thank you very much, this clears up everything I thought that you can only visualize physical keys and not the other way around Another question then. I can access the website from my computer, but not from my phone. This is probably because the RPi and my computer are on the same router, and the phone isn't connected to it. Is there any way to make this page accessible to anyone?
Hi,
if phone and Raspi are on the same router (so same network) this should work.
Check the IP's for this.
BR
Edwin
Yes it works if they are on the same network. But what if they are not? Is it possible to make it accessible from other networks?
you can forward the port on the router to make it visible to outer network.
Hi! I have forwarded the port for the IP of my raspberry, but I am still unable to connect to webvisu.htm if I am not on the same network. Just to clear things up, I can connect to the page if I am on the same WiFi network with my phone, but when I use my mobile data, the page is unavailable. I'm starting to think that there is no way to make this page available to everyone, let's say you reading this
Hi,
and you have adapted the Port in /etc/CODESYSControl.cfg?
hm ok now I understand... not needed.
What if you give 8080 to 8080
[CmpWebServer]
WebServerPortNr=8080
BR
Edwin