salmonM

Hey again!

I got myself a UniPi to do some analog signal control. I think i have set it up correctly and currently using factory io as the environment. The hardware layer is configured as UniPi as well! 🙂

I installed the UniPi API and i can see that the board updates the signals when i apply them and can read artificial output voltages.

I am using %QW0.0 as AO, %IW0.0 and %IW0.1 as input 1 and 2. I am not getting a signal when i go to the monitoring page (or in factory io). Could it be a problem with data types? I have tried using INT and WORD as input/output data types.

Other issues with analog signals i should know?

Best regards

salmonM
Capture.png 
Reply 0 0
NWT.Stuff
Try UINT
Reply 0 0
thiagoralves
It's %IW1 not %IW0.1
Reply 0 0
salmonM
NWT.Stuff wrote:
Try UINT
Will try!
It's %IW1 not %IW0.1
Ah i see! Thanks. I was looking at https://www.openplcproject.com/runtime/unipi/ and there it says 0.1 and so on.
Reply 0 0
NWT.Stuff
@salmonM A working example albeit with RPI GPIO

Tags.jpg 
Reply 0 0
salmonM

Thank you! Will use this as a reference to my own setup. Just curious about the M-addresses, are these the native RPi addresses? I thought these addresses are always on the form %IX / %QX / %QW etc. Are there any good resources on learning about this?

I'm a bit of a noob and I'm learning while doing right now, so sorry if i ask lots of questions.

Best regards

Reply 0 0
NWT.Stuff
Have a look at the Open PLC reference documentation there is a lot of helpful stuff in there. Regards, Kevin

M Addresses are Holding Registers in the PLC. 

https://www.openplcproject.com/reference/modbus/ 

https://www.openplcproject.com/reference/plc-addressing/


Reply 0 0
salmonM

Hey thanks for the links. I have one remaining problem though!

I think i have the right address for the unipi AO, %QW0, but i can't seem to get any voltage out! The monitoring page shows that output is produced (I'm sending A2 straight in to AO) but no real voltage.

First i thought it was because of UniPis API which was overwriting somehow, bt i unistalled it and still no output.

Any ideas?

Many thanks for the help so far!

Reply 0 0
NWT.Stuff
Can you Post your wiring ?

Is the Analgue Output GND connected to the Analogue Input Ground ?
Reply 0 0
thiagoralves
Read UniPi documentation. If I'm not mistaken, you need to supply voltage to some pins for the analog output to work. They map it all out on the documentation.
Reply 1 0
salmonM
I am unable to take a picture right now but yes it is connected according to the UniPi documentation.
Also the 5V power supply is supplied.

I tried reinstalling OpenPLC on another pi but no success :/
Reply 0 0
NWT.Stuff
Is you're wiring like this ?

https://kb.unipi.technology/en:hw:03-unipi11:description-of-io:05-description-of-ao

I would pay particular attention to the example using internal 12V.  It seems that AOG is getting the Ground from AI1-
Reply 0 0
salmonM

unipi.jpg This should be correct according to the unpi docs i think! And then I've tried both supplying the output from AI1/AI2 and also just sending out a constant output from the program.

Nothing gives me an output! It feels like I'm missing something.

The power supply of 5v is connected just fyi

Reply 0 0
salmonM
Here's the program right now for what it's worth.
prog.png 
Reply 0 0
Reply