metaltest Posted August 5, 2020 Share Posted August 5, 2020 I've setup a quick sequence associated with a button to change the file name based on strings entered in text boxes. For some reason the last character of the last variable in the file name is cut off. Logging.LabJack1.Filename = basedirectory + Page.Page_0.Component.LabJack1Cust.strContents + "_" + Page.Page_0.Component.LabJack1Job.strContents + "_" + Page.Page_0.Component.LabJack1Spec.strContents + ".txt" As as I added variables the 'C' was cutoff, then the '0' and finally the '3' How do I avoid this? Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted August 5, 2020 Share Posted August 5, 2020 I'm not a big fan of the edit box in HMI's, so my first suggestion is to consider using a variable value control to display the current settings, and a button next to it that pops up a query for the value. If you really want to use edit boxes, then my second suggestion is to put them in a popup that only updates the filename when the popup is dismissed with an OK button. Putting edit boxes on the primary pages of your HMI is a bad idea, for reasons I explain here: Chances are the issue is that the edit box hasn't lost focus and updated the strContents. You could use the setFocus() function of any other screen element to force the loss of focus, or you can probably do page.myPage.submit() Quote Link to comment Share on other sites More sharing options...
metaltest Posted August 5, 2020 Author Share Posted August 5, 2020 That totally makes sense. Is there a way to dynamically read and write multiple variables in the popup? Like set a global variable to "2" when opening the popup and reference that when opening the popup to set the current values and then use it set the values on submit. Basically using a variable within a variable. Quick Sequence code in the Button Component from the main page machine_settings = 2 Page.Machine_Settings.Component.Customer.strContents = Page.Page_0.Component.Cust_Machine_(machinesetting).strText Page.Machine_Settings.PopupModal() Set Channel (from the Edit Box Component) Page.Page_0.Component.Cust_Machine_(machinesetting).strText Quote Link to comment Share on other sites More sharing options...
metaltest Posted August 6, 2020 Author Share Posted August 6, 2020 Figured out how to do part of it with the evaluate function, but then realized an array would probably better handle this and then could be used to display data fairly easily in a table element. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.