- Posts: 59
- Thank you received: 1
andypugh wrote: it sounds like your HAL file needs to "loadusr" your Python program and wait for it to finish loading (loadusr -W) then the HAL file can carry on and connect up all the pins.
ie, the Python script creates HAL pins, the HAL file connects the pins together.
You probably _can_ connect the pins from inside the Python script, but that depends on pin names never changing.
You can not (in HAL, or by any other means) connect pins to more than one net.
If you want to programmatically connect pins that are already in a net at that point then you need to connect to the _signal_ not the pin.
This typically uses a "net" command with the prexisting signal name.
We would be able to guess what was going wrong a lot more readily if you pasted the error messages into your messages rather than saying "nope that doesn't work" and leaving us to guess what you did, what you expected to happen, and what actually did happen.
Please Log in or Create an account to join the conversation.
Simpson36 wrote: Meanwhile, if anyone has a suggestion on how to get h.ready() to work in the Python component library, please share. THANKS!
Please Log in or Create an account to join the conversation.
SO . . . this python propram has to run first . . THEN the last hal to do the netting. :woohoo:
Please Log in or Create an account to join the conversation.
How would I go about connecting the pins using Python? That would solve at least some of the problem.
Please Log in or Create an account to join the conversation.
Well, firstly, what is "h" and does code execution reach the "ready" line?
You can get the symptoms you describe if the file name and the component name don't match. The HAL component name and the name of the file that creates the component need to be the same, I think (or, if they don't, you need to take special steps)
Please Log in or Create an account to join the conversation.
newbynobi wrote:
SO . . . this python propram has to run first . . THEN the last hal to do the netting. :woohoo:
Please publish you complete config folder with all needed files, otherwise I can not help. Have you taken a look at plasma.py from sim gmoccapy gmoccapy_plasma?
You can just include a complete python program in the _init_ part and the handlers will do the math.
Norbert
Please Log in or Create an account to join the conversation.