AOUT value

Universal Controller for CAN Applications
Post Reply
olivierk
Posts: 4
Joined: Tue 28. May 2013, 14:45

AOUT value

Post by olivierk » Wed 10. Jan 2018, 10:49

Hello,

Does someone know if it is possible on PCAN-MIO with PPCAN-Editor to read a value from AIN, make some calculations and based on the result set the value of AOUT?

Thanks.

Olivier

G.Bohlen
Hardware Development
Hardware Development
Posts: 63
Joined: Wed 22. Sep 2010, 21:38

Re: AOUT value

Post by G.Bohlen » Wed 10. Jan 2018, 11:49

Hello Olivier,

yes, this is possible.

In the PPCAN-Editor2 you can go to the configuration-window, select tab "Function Blocks" and add a new Record.
Look at the document "Help/PPCAN-Editor_References" for all available function blocks.

Now you can select a Function code, e.g. Scaling. (output=input1*scale+offset)
Next you select the input1 of the function. To select Pin AIN0, you select
Input 1:
I/O Function="AIn level (90h)"
I/O Number="AIn0"

Input 2:
unused because Scaling block has 1 input and 1 output.

Output
I/O Function="AOut Level"
I/O Number=AOut 0"

Parameters:
Here you select scale and offset for the desired calculation.
output=input*scale + offset

Cycle time: choose how often this calculation should be done e.g. every 10ms

You can also do calculation in several steps. The intermediate result can be stored in a 32bit variable.
Choose a 32bit variable as output of a function block and input of the following function block.
(I/O Function: 32bit Variable, I/O NUmber 0..255)
If several steps are used, set the cycle time to the same value for all these steps.

Regards,
Gunnar Bohlen

Post Reply