News:

SMF - Just Installed!

Main Menu

Automated Home

Started by Mahkizmo, March 09, 2018, 11:24:28 AM

Previous topic - Next topic

Mahkizmo

Hello everyone!

Long time ago i wrote in this forum.

I was looking at the Automated Home machine. There are some analog inputs there.

For Example there is a lightsensor, if i look in the Variable table it has a fixed value at 96.5 and it never changes. Also there is a clock that says 9:10 but never changes as well.

Tried to find it in the machine editor but to no avail.

How does the analog inputs work in easyPLC, have been trying to change the values to different ones and also letting the simulator run for a long time while looking at the trace window.

Also couldnt find any info in the manual or that it was a premade program for this.

This should be an easy task since its value is between 0-100 and basically just set transparency/darken window if the value is < or > xx

Any help would be appreciated.

Sincerely/ Mahkizmo

EasyPLC_Master

Hi!

There are three analog inputs:

Anlog input 0 -> is a Light sensor (0-100), that indicates the external light
Anlog input 1 -> indicates the external temperature
Anlog input 2 -> indicates the home internal temperature.

The analog I/O are very easy to use in EasyPLC, you only must to declare in the variables section and asign the new variable created to the desired anlogic I/O. You can open the example program MachinesSimulator_PickAndSelect.plc, where the analog I/O are used.

In this machine is selected the SkyBox type Day/Night, this skybox has a property called SkyMode that could be: Manual, Automatic or Actual Time.
By default is choosen Manual, this means that you must to use the Keys 'N' and 'M' to change the hour of the day, if you choose automatic this will change automatically and if you choose Actual time, the hour will be the same that your computer.

This means that the SkyBox by default is in manual mode, then press the 'N' and 'M' keys to change the hour and the values of the sensors for light and temperature.

Hope this helps you!
Regards.


Mahkizmo

Hi!

I'm aware of those AI 0-2.

That skybox/skymode wasnt mentioned before starting the machine nor how to operate it.

I tried the N and M buttons and it works, it changes the time of day as well as the AI.0.0 Lightsensor changes between 0-100.

But how can you use that skybox/mode to set it in automatic/manual as a variable, If i check the IO while pressing down N or M theres nothing there, which means that its outside of the IO connections, so there is no way to set it in manual or auto or current time of day.

Also what i saw in the PickAndSelect program, apart from being written in script with switch commands there is nothing about the skybox/skymode there.

Only that movepickerposx,y,z is set at fixed float values and when its in that position you break the command and go to the next statement.

The only solution i can think of at the moment is to use script for the keys like.

IF Key(M).IsPressedDown SET randomflag;

IF (randomflag == true) Frequency Signal 1(@ 1000ms) AND C1(++);

atleast something like that. If there is an easier way i'd like to know =)


A bit offtopic.

When i was trying to compile the product automation system basic i got a fatal error due to the internal frequency signals on the virtual CPU.

Not sure why since i only set which signal to use, enabled = true, Base Time 200ms and second one on 500ms.

Havent got that one before and havent had issues using those earlier with your software. I will try to investigate a bit further about that.

EasyPLC_Master

The way how the Day/Night SkyBox type works is configured from the editor, you must to open the machine with the editor, and change the property as explained.

About the fatal error, please send the .plc program that causes the error to info@nirtec.com, I'will look what happens.