PLUS+1 Hardware > Controllers

Inputmode_problem

(1/3) > >>

macbahi:
Hi!!!

I use SC050-120 pin 32 as input.
I have option to use two sensors analog and resistance.
So I have using switch to do that as showing at the first image.
As result compilation error Initialize Hardware output must be connected to an output which is valid for initialization.

Please could you help me

thanks in advance

Cordially
macbahi

FluidPowerTom:
The inputmode along with outputmode cannot be changed programmatically like that.  You need to pick one for that program and use another input for the other sensor.

Matt_Eng:
Hi, there is a way to do this, but it does require modifying the template slightly, I've mocked up a little example for you.
To do this properly, you only want the input mode to be able to change after a power cycle.

In the sub block of the pin page, you will want to separate the Init and InputMode signal.


Then you would setup the NV component to drive the init, and limit the InputMode to only be set on the first loop.



You can also do a similar thing for setting the baudrate of a controller without requiring a recompile.
Hope this helps, Matt

Tor:
Hello,

Just to clarify what the initial problem is.
The INIT component writes a value to the kernel before the first program loop and it only accepts inputs from constants and non-volatile memory components. So the compile error you get is probably that you have a switch connected to the INIT component.
But as Matt_Eng pointed out you can just separate the INIT and HW inputs. You can connect a constant to the INIT input and have your logic connected to the HW input.  The INIT is not used while the application is running.

You can find this information by mark the component in the component tree, and press "F1" on your keyboard.

Good Luck

macbahi:
H!

Thank you very much Matt, Tom and Tor.
It's no easy for me to understand HW Init configuration but I understood your ideas.  I will do that.
But why originally it's not separate and we can change Input-mode value.
Please Could you refer where I will find more information about Init using and HW?

An other time thanks for your help,

Sincerelly
macbahi

Navigation

[0] Message Index

[#] Next page

Go to full version