Hellofirst of all let me say that I am new to Labview, but have been working with it for a little while now and am starting to get the hang of it. The project I am working on is a VA for a test system for a bunch of cables, each one serialized. The idea is that the user selects a directory, and then for each test enters a serial number while the VI grabs the data (from a network analyzer) and writes it to a text file in the selected directory with the name being the serial number with the .txt extension.
I have this working pretty well, but we would like to integrate a barcode scanner. We have a bunch of scanners which emulate USB keyboards, so it is simple to have the user just click in the text control for serial number, and scan the cable. However, we would also like to be able to have it so that the user does not need to do anything other than connect the cable and scan it. The scanners have are set up to append a carriage return to the end of the number it has just scanned, basically simulating hitting the Enter key. I set the button I use to trigger the test to toggle on Enter, so just scanning a bar code will start the test and save the data. However, it will not clear the text control; rather, the previous serial number sits in there while the new one is appended to the end. How can I clear this field programmatically?
You can just use a local variable of the control and write an empty string to its value, or use a Property Node and select the Value property. You can create either one by right-clicking on the control and selecting Create -> Local Variable or Create -> Property Node. With a property node you can use the error clusters to establish data dependency to make sure the clearing of the control only occurs after the test is finished. If you use the local variable you must make sure that that writing will not occur until you've actually completed the test. Here's a simple example of what is meant by this:
Why? Why go though the VI Server when a simple local variable is just as effective, and probably way faster. The only issue would be to eliminate a race condition, which is solved trivially. Local variables are not EVIL.
One reason that comes to mind is if you end up reinitializing the control in multiple places. If you use a constant then you will need to update all the places you initialize the control to it's default value. Whereas using the Invoke node allows you to assign the default value as an attribute of the control itself and should that value change you have one place to update it.
As a general rule of thumb I try to avoid the use of local variables and property nodes and stick with pure data flow programming. Granted this is not always possible. By not using them I tend to think more about my design and architecture of my application and develop something that is more robust and flexible. Over time you build your bag of tricks and find you only need to use them on rare occasions.
Although if I try using a button using the copy function Ex: on select: Copy(dcStem.HtmlText), then paste it into other programs, all the HTML tags are pasted, and MS Word or others do not apply the formatting.
Interesting. Thank you for a really detailed writeup. This is basically exactly what I'm after. I want a gallery of rich text templates so my users can select a frequently used template and copy and paste to their destined program.
Hmm, mine is definitely working - I just checked it again to be sure! But I did have a lot of issues in other ways getting this particular panel to function how I wanted it to as the data goes on a bit of a journey.
For context, this is in a Canvas app. I have a 'create entry' screen where the users enters text into a Rich Text Editor (amongst other controls). They press a button that patches that content (and the rest of the data) to a row in a Sharepoint list. That column is a "multiple lines of text" type with "Use enriched text" set to off.
There's then a 'main interface' screen with a gallery on the left that displays the contents of that list, and another rich text editor box on the right. Selecting an entry in the gallery sets a variable with the row ID. The rich text editor's Default is to Lookup the data in that "multiple lines of text" column from before using the row ID. Then finally, the Copy button has the Onselect we talked about - in my case Copy(PlainText(ET_ComplexViewer.HtmlText))
And that, when I paste it into Outlook, works ? That was a long story but I thought high detail is important, there may be a subtle element here that explains the difference or inspires you to find the source of the problem. I was having issues where...I think one of the earlier controls or steps in the process was stripping out the 'richness' of the rich text, so all the steps further down the line were just treating it as regular text.
I had some luck just now by using Copy(PlainText(HtmlText1.HtmlText)) and then pasting the result into an Outlook email (also tested Excel). I am relieved but I have to admit it does feel a bit counterintuitive, like I would have thought "PlainText" by name would copy the text with the tags, in its plainest form. But oh well, I am not complaining!
Strangely, if you copy and paste with your mouse or keyboard shortcuts, it pastes without the HTML tags. It seems to be an issue with the Copy() function. I am also looking for a solution using the Copy() function without HTML tags if anyone finds one, thank you in advance.
Full Text Control is a feature that enables specific Dragon functionality in text fields on the Web and in applications. The DragonBar's Full Text Control Indicator is on () when your cursor is in a field where Full Text Control is available.
I've just migrated to PB 2019 R3 2703 and need to remove an obsolete rich text edit object and replace with the new TX Text Control feature. I've changed my application object to point to the Built In TX Text Control Active X 28.0 per the documentation. According to your Visual Enhancements to PowerBuilder 2019 R3, when inserting an OLE object I should see the option to choose this new feature but I do not.
Hello to everyone who responded and tried to help! I apologize for the delay in responding, I've been meaning to for a while now. Because the issue we were experiencing was in a non-critical application we decided to work around the issue by sending any images as attachments. Not the preferred solution, but we didn't want to put any more time into it by incorporating any 3rd party tools.
The one issue I was having with the new built in text control was resolved by registering the .dll. I did not wind up needing it anyway, but again, I want everyone to know how much I appreciate their responses!
Describes guidelines and conventions for implementing ITextProvider, ITextProvider2, and ITextRangeProvider, including information about properties and methods. The Text control pattern enables applications and controls to expose a simple text object model, enabling clients to retrieve textual content, text attributes, and embedded objects from text-based controls.
To support the Text control pattern, controls implement the ITextProvider and ITextProvider2 interfaces. Control types that should support the Text control pattern include the Edit and Document control types, and any other control type that enables the user to enter text or select read-only text.
The Text control pattern can be used with other Microsoft UI Automation control patterns to support several types of embedded objects in the text, including tables, hyperlinks, and command buttons.
A text range object is represented by the TextRange control pattern, which is implemented through the ITextRangeProvider interface. The TextRange control pattern provides methods and properties used to expose information about the text in the range, move the endpoints of the range, select or deselect text, scroll the range into view, and so on.
3a8082e126