• Content Count

  • Joined

  • Last visited

Everything posted by MrDeathStar

  1. MrDeathStar

    Reserved Word Warning

    Today I was moving code from some old sequences into a single new sequence with a switch statement. The old sequences were being called by some variable value components and worked well. I updated the components to call my new sequence and DAQFactory locked up. Sequences that demonstrate this problem are attached. TimeAsVarName.ctl It is interesting that the old code works well but a lockup occurs if I use the case statement (with the variable declared outside the switch code). The problem seems to stems from the use of 'time' as a variable name (since 'time' is likely a reserved word). It might be a nice future feature to have the parser fail with a warning if a reserved word is declared. Not sure why DF hangs.
  2. One of our applications that typically runs continuously for many weeks/days suddenly became extremely slow (over this past weekend). The operator experienced page refresh rates of 1800 to 3200ms on pages usually running 70 to 300ms. Application threads seemed to be running at expected rates with typical 'delay' intervals. Logging and data acquisition did not appear to be affected, just screen repaint performance. Channel data history lengths had reached their limits many days earlier. DF was the only application running. The application is built as a sequence of tabbed "pages" where a tab's page is shown by merging it with the main control page. Each page can be separately displayed (without being merged) through the DF interface. Surprisingly, some pages containing several graphs were found to be fast, while other page seemed to be abnormally slow. The common element on those pages seemed to be the Symbol components. However, creating a new page and adding a symbol did not seem to be a problem. The pages with symbol components are typically just small icons and such for custom looking buttons, and the graphic shown may depend upon some variable value. This is the first time we have experienced this issue with DF (though we have been previously using 15.9x versions). Have there been any reports concerning symbol components (i.e. or internal DC memory handle leaks, etc.) that might explain the sudden speed decrease? The only solution was to restart the application, which required an experiment interruption, but all started working again as expected. Thank you for your time. DF: 16.3
  3. I will need to determine if the company will allow us to share the .ctl document as the experiments are under IP. However, I can comment on the behavior. Yes, the memory usage of DF was higher than other applications we have created...approximately 1.2GB at the time of the event. All charting and channel histories were full and working as expected. I am sure that could contribute to an issue, but the application has been in use for several months without issue and was recently restarted last week (before the problem was observed.) While all pages in the application were slower, the typically slower pages having graphs were not impacted as much (maybe only twice as slow). Pages containing button, text, variable value and symbol components were far slower. (I only guessed symbol components could be the issue because two pages not having them were far faster.) The 60ms main page, for example, went to 780ms by itself. It contained a handful of buttons, panels, and symbol components. The application does use a few canvas components too, but not on all pages. The pages with canvas components have several symbol components as well, so it is hard to separate. The slowest page is usually about 250-350ms, but was operating near 3000ms. The application is using LabJack and makes calls to the LabJack library directly. The main threads for collection and logging were reporting correct delays, etc. The command / alert console window (as always) was in use heavily, but newly created pages were fast. So it could be that accessed something was slower, but the main page does very little. It is true that several screen components do make calls into a common script object to collect state (very quickly conditionally accessing different local variable members), so it is also possible that if that object was somehow 'locked' too long in script it could delay rendering. That common object only handles GUI state and has a fast background thread to monitor state from other application objects. Is uses a 1-2 second delay between attempts. The application is written using several processing threads managing their own event 'queues' to avoid contention. The thread processing seemed to be operating correctly during the slowdown...only screen updates and general slowness in the GUI were observed. It appears this may be an unusual condition so we will continue to monitor it and report again if it occurs. I submitted another strange edit box problem observed once and wonder if it could be related, as it too is a GUI control element. I welcome any further comments you may share.
  4. MrDeathStar

    Dual USB keys

    Can DAQFactory identify two USB keys? We are using USB keys for our runtime licenses and developer licenses. The runtime license is typically plugged into a computer locked in the equipment cabinet. An external USB connector provides cabled access to this PC. When I insert the developer USB key, I was hoping it would override the 'runtime' license and allow me to make local code modifications. Alas, DAQFactory reports that the license it finds is only runtime...I need to remove the internal USB key before it will detect the developer license. If we had installed the runtime directly (without using a USB key) would this have operated as expected? Your comments/thoughts are appreciated...thank you.
  5. MrDeathStar

    Line Annotations

    I added a single Line Annotation to the ''Left Axis 1" of my graph. The expression is a global variable (i.e. g_level) which is changable by a user control (i.e. SpinButton) to provide a way to mark a threshold level. The Line Annotation is drawn if the global variable's value is within the Scale To/From range of the "Left Axis 1". Once drawn, however, if this value goes outside the axis range, the Line Annotation remains incorrectly drawn at the last prior expression value within the range. It is not removed from the graph. The Line Annotation is removed as expected only if there exists another Line Annotation in the graph that can be drawn. On a related note, how do I delete a Line Annotation? For example, create a 2D graph. Add a line annotation with expression set to value 1. (Line annotation appears in the graph.) Delete the line annotation. Result: A line annotation still appears in the graph. 5.87c / Build 2050
  6. MrDeathStar

    Gettextextent And Font Size

    I figured it might have been a simple SelectObject related thing. The dummy TextOut was a stab in the dark, but if it had worked I would have probably questioned potential DC object leaks from not selecting it out. Since the forum did not have much regarding GetTextExtent, I gather it is a seldom used/tested feature. So, thanks again for a speedy fix with the 2230 update!
  7. I am using the Canvas component to center some text features among custom graphics. I call Draw.SetFont() and Draw.GetTextExtent() to calculate text positions before drawing. However, GetTextExtent() seems to report the same pixel size regardless of the font size chosen. Since SetFont() does not use a DC argument, I tried a dummy TextOut() using the chosen font to see if that would set the DC before calling GetTextExtent. It did not work either, so any help is appreciated. Thanks. (ver. 2203/2224/2229)
  8. MrDeathStar

    Text Component In Popup

    Did not find 2225, but it works as expected now in 2224. Thanks!
  9. Not sure where to report this issue as I am using 5.91 build 2215. Text Components with transparent background display correctly on a page, but have white backgrounds in a Popup. They worked as expected in 5.87c and 5.91 build 2203, but seem to have lost this ability since build 2210 or earlier. (It does seem that Popups in the unreleased builds don't flash a white background before painting the page color...nice fix). Have the changes since 2203 limited some functionality in popups, or could this be just a simply side-effect of another change? Thanks for your insight. PopupWithTransparentText.ctl
  10. MrDeathStar

    Flatten() Function Trouble

    It works...thanks (and I am not intending to use it with time data, so all is good).
  11. I was working with some point arrays (for drawing functions) and came across this puzzle with Flatten. It seems that I get different results depending upon how the source array has been previously manipulated (e.g. applying constants vs variables). The code is very short and outputs to the console window. It is particularly visible if the offsets chosen are negative. Could I be making some error with array allocation, etc.? v5.91 / 2203 TestFlatten.ctl
  12. MrDeathStar

    Text Component In Popup

    FYI: Also affects variable value fields too...transparent background is forced white in the popup (bummer). (beta 2210 through 2222).
  13. Wow...thank you very much, I'll give 2222 a try over the weekend as we can really use it! (FYI: if no parameters are given (stupid me) to LJM_Close() it reports "improper number of parameters in eReadName: Line 1"...not 'in LJM_Close'.) And hey, thanks for all the time spent in forums responding to various issues and 'features' I bump into during development. I always appreciate your kind comments, workarounds, solutions, and explanations. To me, a key strength of DAQFactory is scripting, and that is the reason we chose your package for our needs. But, I do feel like a pest sometimes reporting rough edges I find here and there in the forum...maybe there is another 'bugzilla' like place for that? In any case, much appreciation extended to you and your developers. Regarding 'beta features', I know you probably can't comment on future releases, but I was just curious if there is a basic release plan/interval with DAQFactory. We have only been a customer since April. The latest release 5.87c was last December, and 5.91/2203 last October was only RC. But we have needed beta 2215 for graph reasons (and now probably 2222 for this LabJack T7 issue.) It's not really an issue since beta is working well for us, but as product features can change, it's nice to be aligned with official releases.
  14. We are using ethernet cabled LabJack T7 devices (channels and streaming) and found that the device identifier (IP address in my case) seems to associate with some internal handle used to initially open the device with that identifier. If there is a short network error (or remote T7 power failure) and reconnection fails, LabJack reports LJME_RECONNECT_FAILED. However, at this point DF can no longer reconnect to the device. I cannot find a way to reopen the device using the same IP identifier, since it remains associated with the now non-working handle. I must close/reopen my .ctl file. If I setup my own extern methods to call into the LabJackM library, I can use 'LJM_Open' to obtain a new handle and even call other helpful methods such as 'LJM_eReadAddresses' as needed. If I receive a connection error, I can close / reopen the device and obtain a new handle. However, streaming methods in the library seems to require special support which I may not be able to create myself with this extern method (and DAQFactory already has nice methods for this, as in the LJM_Stream example). Is there some way to reset any DAQFactory mapping between 'identifier' and its internal LJM_Open handle? Or, is there some way to force close/reopen of the device again? I tried Channel.Reset(), and creating a new Channel, but it did not work (and certainly not for LJM_eWriteName methods). Once such a device error occurs, DAQFactory seems to attempt using the same handle for the given identifier. You can duplicate the problem by setting up an extern method to manually call LJM_Close on DF's handle (or LJM_CloseAll). While not totally fair to DF, it does show that once the driver handle goes bad, DF cannot reconnect to the device using the same device identifier (e.g. IP address). Since it's possible that a wireless T7 may experience such troubles, it would be important to have a reconnection after failure procedure that does not require rebooting the DF application. Thanks for your comments.
  15. Yes, I too think it's great how DAQFactory acts as a pass through for most devices because it does allow companies to improve their drivers independently. "It gets a handle when it opens the device and then continues to use that handle." - This was my finding, and yet it would be appreciated if that handle could be reinitialized or closed (i.e. some scriptable way to ask DF to close a device identifier/handle or open it again). Currently when a device identifier (i.e. IP address) is set in Channels, DF will open the 'new' device. But returning to a previously used identifier just recycles the old handle which may have been closed. (Even LabJack drivers can close all handles via someones call to CloseAll, so it would be nice to have a recovery procedure for such situations.) Maybe Restart() with a parameter having the device identifier that needs recycling, or some other flag to indicate to DF that its handle is invalid and will require re-open when next used. For now I can reopen a device with the same identifier using my own extern methods into the LabJack driver...but I lose DF T7 streaming capability since those methods rely on the invalid original handle.
  16. Thanks for your detailed reply and design tips. Regarding (1), I do have a menu but it's in the main page. I can change the menu to its own page and always have it last so the button only changes pages above. In this instance the menu was on the main page and I was trying to have one of the 'menu' buttons toggle a 'help' panel over part of that page. I did not put any components in the 'help' panel (including a close button) since, as you mention, clicks might pass through to the page below. I could use a 'hidden' panel and have the menu button make it visible/hidden. Of course, I could also use an actual popup window too. Thanks for your tips. Regarding (2), thanks for the double-click are correct.
  17. I was coding a quick sequence that modifies Page.strCurrentPage in a button component (5.87c). I found that the quick sequence can be called twice if the button's page is part of the new Page.strCurrentPage list. In my case, I was trying to use a button to toggle between "Page_0" and "Page_1,Page_0" where Page_0 is my main page and Page_1 is a help panel. It seems that the click event for the Button on Page_0 is passed though again to the same Button immediately after changing to the new merged Page_1,Page_0 pages (similar to how stacked components like panels under symbols can get clicks in the stack.) I have attached an example showing the issue. Monitor the command window for output with each button press. If you press the 'Page_0' (top) button, then Page_0 is set and emits "Page_0". If you then press the 'Page_1,Page_0' (middle) button, it merges the pages but calls the button event twice which emits "Page_1,Page_0" twice. Order is important, since pressing 'Page_0' (top) followed by 'Page_0,Page_1' (bottom) button does not pass the event twice. Any tips on preventing this effect since I intended to use the button to 'toggle' the page changes? Calling a sequence that does the change seems to help because the sequence is already running when the second event attempts to begin the sequence again...however, could the sequence run fast and allow the extra event to pass though sometimes? Maybe I could set a flag in a quick button sequence with the 'On Mouse Down' checkbox set, and then use that flag for another normal quick sequence in the button. Other ideas? Thanks for you time. PageChangeTest.ctl
  18. I started using "Group Components (Ctrl+G)" today. I noticed that the z-order can reverse if I select components using Ctrl + Shift + Click. This does not happen using the lasso. It also seems to occur with like kind components (i.e. panels vs panels, text vs variable value) but not always among different types (i.e. panels vs text). Steps to reproduce: (1) Create a 1st panel component. (2) Create a 2nd panel component. (3) Select and move the 2nd panel to overlap the 1st panel. (4) With the 2nd panel selected, use Ctrl+Shift+Click to also select the 1st panel. (5) Right-click (menu) Group Components. RESULT: Panels reverse z-order. I discovered this while attempting to group a panel I created to cover the date output of a graph control. This occurred in version 5.87c and 5.91/2203. It's only a small issue, but would be a nice repair in a future release. Thanks.
  19. MrDeathStar

    Step Plotting Method

    Ok, good idea. I had not thought about that option. However, even though the most recent data point is missed, the starting condition is strange and the work-around fails badly in the PulseB example. For now, I think I will continue with my double channel entries to simulate desired behaviour. Maybe a step drawing order could be considered as a future feature request...(and availability on the right axis too). In any case, thanks for your quick response!
  20. MrDeathStar

    Step Plotting Method

    I am plotting a digital output value vs. time with the step (21) plotting method. However, I noticed that the rise is drawn before the run when a new data point arrives. Is there any feature to allow the opposite (i.e. draw horizontally first and then vertically step up/down to the new value)? The horizontal line on the graph would then indicate the digital value over its time period. If this is a 3rd party graph limitation (i.e. like I found that right axis cannot have step), then I will proceed with regular point/line plotting methods and pad my channels to create the step. Thanks.
  21. MrDeathStar

    Step Plotting Method

    Sure...I provided a quick example. Just curious if this is an option in the current codebase, or if I must simulate it. StepPlottingTest.ctl
  22. My C++ background got the better of me today as I found a silly issue with my sequence code not working because I was using 'private' variables incorrectly with regards to scope. The dynamic strength of DAQFactory allows private sequence variables, once executed, to be available until the sequence ends (in any block, not just for the local code block scope). In my case, I had declared an uninitialized private variable in a while loop which conditionally appends arrays to the variable. At the end of the loop, the arrays (if any) are processed. I incorrectly assumed the private variable was reset empty with each loop interation. I found that using arrayVar.ClearHistory(), even though the variable is not a channel, resolves my that a valid/preferred way to reset a variable?
  23. I was trying to use the OnLButtonUp event with a slider component but found it did not fire (5.87c/2050). Some other events, like OnLButtonDblClk and OnPaint, seem to work as expected. Are some of the mouse events currently unsupported by certain components? If so, I can use another approach. Thanks.
  24. MrDeathStar

    Members As Arrays In An Array Of Objects

    Cool, I will use it for member variables. I also found that I can use g_arrayOfClass.method() to invoke a method on all objects in the array without writing looping script. But, it does seem particular to methods that return a value, otherwise I get a "can't pull data from multiple objects if the data containms multiple rows" warning (5.87c). Adding a return value to methods is simple, but I will refrain from calling methods() this way if it is unsupported. Thanks again.
  25. I came across a cool feature with the undocumented OOP scripting that I may have missed among the forum docs. I created a class to group several related member variables. Then, I built an array of these objects. As expected, I can access a member variable for an object in the array using g_arrayOfClass[nArrayIndex].member. However, I was not aware that I could use g_arrayOfClass.member to return an array of the member (one for each object in the object array)! This is extremely useful for gathering an array of elements in the object list for filtering, etc. (Currently, my script loops over the object list to check members or builds an array manually when needed.) I know OOP is officially unsupported, but I am curious if this 'feature' is by design...I don't want to code myself to far into unsupported territory than necessary. Thanks for your insight.