The problem of multi-tasking. NI-3000
patriot_stv
Posts: 26
Nudge the, please, on the right idea how to solve the problem.
The controller works with three pairs of devices:
The problem appears when the need to handle events from all devices.
For example, the IO port gets a permanent event and starts the cycle. At the same moment, tuner sends a large amount of feedback and, accordingly, is required to disassemble the cycle by using the string character by character.
In such a situation, pressing buttons MIO reaction occurs with great delay.
Is it possible to have Netlink prioritize?
For example, to stop the implementation of all cycles, processing feedback, during the execution of Button_event.
Share your experience, how to solve these problems ?!
In advance thank you very much.
The controller works with three pairs of devices:
- port I/O > Relay Receiving event IO port starts the cycle lamp is flashing through the relay.
- T.Panel > Rs232, Tuner. Panel receives feedback (A complex algorithm with symbol-wise analysis of the string) and controls tuner.
- Mio4 > Rs232, Projector Feedback and control
The problem appears when the need to handle events from all devices.
For example, the IO port gets a permanent event and starts the cycle. At the same moment, tuner sends a large amount of feedback and, accordingly, is required to disassemble the cycle by using the string character by character.
In such a situation, pressing buttons MIO reaction occurs with great delay.
Is it possible to have Netlink prioritize?
For example, to stop the implementation of all cycles, processing feedback, during the execution of Button_event.
Share your experience, how to solve these problems ?!
In advance thank you very much.
0
Comments
Can you post the code you're having trouble with? That will help us help you.
Kevin D.
I correctly understand that while working cycle (triggered in the presence of the event in the IO port), a cycle that handles feedback from the tuner does not start?
For example, here are two of my piece of code:
******Port IO event handler*****
******Tuner feedback handler*****
P.S. If someone has the desire and free time, I can send the full project!
But, In the code present, there is a portion that deals with button feedback on the panel in which the feeback triggers a channel event (the feedback on the panel) then in turn starts a timeline. the timeline has two "ticks", each at one second intervals (1000ms) Those "Ticks" turn the relay on and off respectively. Then the whole thing repeats. So, you should see a relay pulsing on and off each second.
In addition, within the timeline there is essentially a pair of constants which are counters (each is set to 250 if I recall) The timeline is keeping track of how many times it has fired. So when the whole timeline has run 250 times, it shuts itself off by turning off the feedback channel, thus "killing" the timeline.
Is the thing I describe above seem to be killing your master? (not allowing it to do other stuff?)
1. If the IO port included - Includes relay 1 operation (1sec - On, 1 sec - off) ... endlessly until enabled port IO.
2. If a certain time has passed, and IO port still included - in addition to the work include Relay2.
3. button_event [Panel, and 678] and channel_event [Panel, 678] - a button on the panel, which allows you to disable Relay2.
I also think that the main problem in this module. But, to be confirmed more experienced programmers that this solution of the problem "kills" the Master.
But I don't think that will include anything more than "specsimvol = mid_string(fString,i,3)" as part of the first case. And it will keep executing this whole select active section as part of the default case. You may want to add another layer of braces like this:
Yeah, I believe a case with out braces after will only execute the 1st line of code after where as all lines will exectute if enclosed in braces. Similar to how code after a Wait works. You would think the compiler would see that as a malformed switch case and not compile though.
However, this part of the code itself operates.
The problem comes when you need to handle both events IO port and feedback from tuner.
Or something I do not to understand?
This triggers an infinite loop and the system can not respond quickly to other commands.
I think we should try to put the code handling events IO port in the "buffer" ... and return to its implementation only if the controller has a free system time.
But, I do not know how to do it correctly. I will try....
I would appreciate any advice or example code.
If I succeed, I'll show how I solved the problem
Can you post the code in which the infinite loop occurs? Then perhaps we can help.
I will repeat it (remove all unnecessary and translated into English commentary)
I also don't see the point of doing that TIMELINE_RELOAD() when you didn't change the timing at all. Maybe you meant to use TIMELINE_SET, to reset the timeline.repetition back to the begining?
Here's an example using a feedback timeline, and also combining your 2 identical timelines.
Troubleshooting: so rare nowadays it's a fricken super power.
Yeah I've been toubleshooting my entire life, actually no, I've been getting in trouble my entire life, that sounds more accurate.