Reuse signal in postgui hal file

More
3 years 1 week ago #283461 by Guglielmi
Hello,
I would like to show the spindle frequency on my HMI.
The frequency is read through modbus and it's linked already to a signal "actual_speed", I use it to perform some check in ladder..
Well, in postgui, I would like to use the same signal and link it to a HALLabel.
It's possible to reuse the signal defined in the HAL file into postgui HAL?
Should I copy it in a ladder pin?
Thanks
Bye
Andrea

Please Log in or Create an account to join the conversation.

More
3 years 1 week ago #283469 by tommylight

It's possible to reuse the signal defined in the HAL file into postgui HAL?
Probably yes, give it a try, LinuxCNC is pretty good at pointing out errors.

Please Log in or Create an account to join the conversation.

More
3 years 1 week ago #283483 by Guglielmi
Of course I tried a lot before write.. so just reusing the signal doesn't work, in postgui raises an error for signal not existing, I tried also to use a classicladder variable even it's not a nice solution without find a way.
I searched a lot in HAL documentation and on the web looking for a kind of syntax to define signal global.. nothing.
I had the idea to move all related to spindle frequency in the postgui.. maybe in this way it works but I'm also curious to know if it's possible.

So I wrote the post.

Code in the mail HAL:
Code:
net speed_in conv-s32-float.0.in <= classicladder.0.s32out-03 net actual_speed conv-s32-float.0.out => spindle.0.speed-in net actual_speed => near.0.in2 classicladder.0.floatin-00

Code in postgui HAL:
Code:
net SpindleFreq classicladder.0.floatin-00 => AG_CncHmi.lblFreq

It doesn't work, error:
hmi_postgui.hal:31: Pin 'classicladder.0.floatin-00' was already linked to signal 'actual_speed'

but again here I'm trying to use floatin-00, I prefer to use actual_speed directly if possible.

Thanks
Andrea
 

Please Log in or Create an account to join the conversation.

More
3 years 1 week ago #283484 by chris@cnc
Code:
net actual_speed => near.0.in2 classicladder.0.floatin-00 AG_CncHmi.lblFreq
Does this work?

Please Log in or Create an account to join the conversation.

More
3 years 1 week ago #283485 by Guglielmi
The problem is that  AG_CncHmi.lblFreq is a label of my HMI so it should be handled in postgui,
this line of code is in the main HAL ...

Please Log in or Create an account to join the conversation.

More
3 years 1 week ago #283488 by rodw

The problem is that  AG_CncHmi.lblFreq is a label of my HMI so it should be handled in postgui,
this line of code is in the main HAL ...
That is not a problem. Using a postgui file just changes the order of hal loading. Its still updated in real time, but the gui may not refresh immediately.
Alternatively, use this in your postgui
Code:
net actual_speed => AG_CncHmi.lblFreq
The following user(s) said Thank You: Guglielmi

Please Log in or Create an account to join the conversation.

Time to create page: 0.061 seconds
Powered by Kunena Forum