Lookout

cancel
Showing results for 
Search instead for 
Did you mean: 

Polling Queue Monitoring

I'm looking for a way in Lookout v5.0 to monitor which modbus driver objects have been queued for polling by Lookout. I don't care about the data being passed back and forth , I'm looking to determine how the driver objects are ordered for execution by Lookout. For example if I have three (3) modbus driver objects, with poll rates of 5, 10, and 15 sec poll rates, how are these drivers sequenced (ordered) for execution. I want to know how Lookout orders these and display this order on some type of list box within my system to determine when a particular driver may be serviced by Lookout. I have quite a few modbus driver objects (how about 65) communicating through serial radios all working fine, I just would like a little more information about when th
e driver object will be executed as just because a driver has a lower poll rate does not mean that it will be polled before a higher poll rate driver due to the fact that the higher poll rated driver could have been in the queue for it's require poll rate. Ideally, it would be great to display a panel that would allow me to show when the current data will be updated by a new poll of information.
I'm curious on a couple of things:
1. How does Lookout handle the ordering of objects within the polling queue? How is this order adjusted when errors are encountered?
2. Can you have two 'instances' of the same object present in the polling queue at the same time?
3. Order of precedence within the polling queue, how is it determined when conflicts occur? (ex. If I have the above three (3) driver objects enter the queue in the above order right after one another, the 5 sec driver should be in the poll queue first, with the 10 and 15 sec drivers being added to the queue in that order. After
poll by 5 sec driver is complete, which driver is next in the poll sequence, 10 sec. But when 5 sec driver is added to polling queue, is it ahead or behind 15 sec driver? Depends on quite a few variables!!!
0 Kudos
Message 1 of 8
(4,028 Views)
I don't quite understand the motivation behind knowing what's in the queue. But, it seems that you have a need. I know of no way to peer into Lookout's communication queue. I would control the polling programmatically in Lookout using the Poll field and not the PollRate field. This way I could write an expression using pulse timers, delay ons, and/or one shots to control the polling of each one of the 65 Modbus objects. The feedback as to when a Modbus driver has polled its device would be the Update data member. My reasoning is that if you control the polling directly you have no need to look into the queue. Just one idea.

Regards,
Tommy Scharmann
0 Kudos
Message 2 of 8
(4,028 Views)
Thanks for your input Tommy. I know that I can control the driver objects by using the poll field vs the poll rate, but I don't want to re-create the wheel, Lookout has already done this, I just want to look at it! By developing this algorithm myself, I'm effectively removing the polling queue, only one item in the queue at any given time, therefore I would not consider it a queue at all.
You asked about my motivation, there are several, but the biggest one that I have is to be able to programmatically adjust the poll rates and/or field of each of the individual drivers to 'optimize' the entire poll sequence from driver 1 to driver 65 and beyond. By 'optimize' I mean to reduce the amount of time it takes for all drivers to poll their respective devices. By knowing when a item enters a queue and were it is placed allows me to adjust a polling algorithm for subsequent drivers. Yes, I could wait until the update data member completes, but it could be several minutes down the road before I see any response, therefore all subseqent adjustments must be delayed by this time frame, (or some other type of time delay optimization). If you take this through 65+ drivers, you could see an hour+ go by before you may see the results of your labor. I would rather not have this much delay in this algorithm as it defeats the whole purpose, to obtain the most amount of data in the least amount of time. I want to adjust the next driver placed into the polling queue based upon the position of the last driver entered into the polling queue, and a couple of other variables (total polling queue length, total retries, total active drivers, total of all poll rates and/or queue waiting times, etc.) Complications are numerous with regards to conditions that must be taken into account for poor/no communications, retries, etc. I would rather not have to worry about all of this and let Lookout do its job, I just want to alter the properties of the drivers the next go around until an optimal time frame for the entire application has been achived. By comparing time for the overall polling sequence I can see and effectively rank (number) the overall polling sequence. This poll rating would allow the user to know how well his/her system is performing, not just thinking it's bad or good. By monitoring only the modbus data members (ie valid frames, protocol errors, etc.) you do not see the effects of retries, this I believe has a great impact on the polling sequence and subsequent 'optimal' time of application polling. I hope this helps instead of confusing the topic any more that it already is!
0 Kudos
Message 3 of 8
(4,028 Views)
Was chatting with my friend Roland on Sametime about this and we thought it would be a good (amusing?) idea to post it here...

Roland: that's interesting - the lookout modbus queuing...stuff
Roland: so what would be wrong?
Roland: could you answer the three specific questions?
Roland: I couldn't
Khalid: i don't think anybody knows when the exact queing occurs
Roland: 🙂
Khalid: i mean .. the code decides when to queue the poll request
Roland: that means if you manually set the poll for different object it has to poll/queue as well right?
Khalid: well, manual is different.. you have SOME control at least
Roland: because you could specify fast counters... e.g.
Roland: yeap, but just some.
Khalid: but yes, even with manual there will be queing with no control of ours
Roland: if two counters go high at the "same" time it will be queuess...
Khalid: yeap
Roland: okay - I get now your point
Roland: so - we should reply "that's the magic of lookout"...
Khalid: but the Comm subsystem in Lookout will know at least a few milli-seconds in advance as to what object is to be polled next
Khalid: if we can somehow make this available to the user
Khalid: basically, exporting the queue as a read-only datamember
Roland: correct - the comm subsystem or its developer should know how the stuff should work...
Khalid: but like Tommy asks, what purpose would this serve??
Khalid: except as a good passtime for the bored operators
Roland: if you can not schedule the queue there is "no need" to know it 🙂
Roland: 🙂
Khalid: exactly
Khalid: you might as well watch King of the Hill or Simpsons on the next screen
Roland: what?
Khalid: I mean the operators will probably find the TV shows more useful
Roland: okay - I told you I don't have a TV.... ah I see -
Khalid: aha.. maan you're missing all the neat stuff the Americans do
Roland: I guess I post this conversation as comment to Tommy's reply
Khalid: I mean the Homer Simpson and Hank Hill
Khalid: yeap
Roland: yeap
____________


0 Kudos
Message 4 of 8
(4,028 Views)
Thank you Khalid for your insightful response. I hope that most of your replies to this discussion board are slightly more astute than this one.
I do not believe that you can schedule what is in the queue, but I do believe that you can 'influence' the queue to obtain the results desired.
Granted, this is a topic that may have no relevance to your particular application(s), but replying to a question by attempting to ridicule the author seems inappropriate and short-sided. If you wanted to inquire about the question OK, but don't harass, present your position and try to encourage the participants to do the same. Who knows, we may all learn something!
0 Kudos
Message 5 of 8
(4,028 Views)


You got me wrong. Our intention was not to ridicule anybody really. We were just chatting casually. In any case, please accept my sincere apologies.

I fully respect your query. The "chat" was prior to your comment explaining the motivation behind knowing the polling-schedule. With your comment it makes perfect sense why someone would want to do this.

At that point it seemed a good idea to share this for some lighter moments for us all.. but now I feel bad about it. Too late I guess 😞

I am really really sorry for offending you and anybody else.. that really was not my intent. Please accept my apologies.

Regards,

Khalid
0 Kudos
Message 6 of 8
(4,028 Views)
Thank You for your apology! It is quite refreshing in todays world for someone to take responsibility for one's words and actions. With that said, please accept my apologies if I took your 'chat' a little too seriously and not with the jovial attitude intended. The wonders of email!!!!

With that said, any ideas on my original question?
0 Kudos
Message 7 of 8
(4,028 Views)
Though this is a difficult question, I had to think of some answer especially since I upset you 🙂

OK, this is by no means a solution to your problem, but may help you come up with a solution: the Lookout DiagnosticFile logs all serial transactions on a given COM port. (For those who are not aware of this, this diagnostic feature is enabled by adding the 'DiagnosticFile' entry under the right [COMx] section of the lookout.ini file and give a valid path to it.)

The diagnostic log file created is pretty good in the sense that it lists the Object name, tells whether its a read or a write operation and the message frame. It however does not timestamp the events as far as I recall.

After letting your system r
un a typical session, you could look at the log file to see what went on. May be this will give you some ideas as to how to optimize your system.

Hope this helps..

Khalid 🙂


0 Kudos
Message 8 of 8
(4,028 Views)