-
Posts
410 -
Joined
-
Last visited
-
Days Won
13
Content Type
Profiles
Forums
Downloads
Gallery
Everything posted by Black Pearl
-
You can use an event driven queued state machine (or better described as message handler). You will capture all events in the event structure, but instead of processing them there, you enqueue them as commands. You either can use the enqueue elements at opposite for priority events, or you use multiple queues for several priorities. The processing is handled inside the seperate consumer loop of that queue(s). Felix
-
[Discuss] UML2LV State Machin Compiler
Black Pearl replied to Black Pearl's topic in Code Repository (Uncertified)
Roadmap (unsorted): * Extending the set of verification plugins * Loading/Parsing for StarUML/XMI * Creation of String based State Machines * Make it available for newer LV versions (see this scripting question) * Handling of orthogonal states * Converting Notes to Comments on BD * Converting Transition Events/Guards to whatever * Write an easy tutorial Felix -
new design pattern needed
Black Pearl replied to sydney's topic in Application Design & Architecture
You can dynamically launch 7 reentrant SubVIs for each reader. The most recent post on this is the Tale of Two Servers on the dark side. It has evolved into a discussion about queue references and LVOOP, but in the code the launching is shown pretty well. There are also some nice little VIs to assist in the OpenG Application palette. And if you get a two huge spaghetti bowl with the queues, you also might have a look on the event message bus implementation. Felix -
Not showing a front panel
Black Pearl replied to Black Pearl's topic in Development Environment (IDE)
The very first call is VI.FrontPanel.Status=Hidden and the very last call is VI.FrontPanel.Open=False. All I see now is the flicker of the Active VI (BD Open) due to the loss and regain of focus. Is your try in the code (Your GetCCTSnippet link)? Felix -
Not showing a front panel
Black Pearl replied to Black Pearl's topic in Development Environment (IDE)
Not Minimized but Hidden. Felix -
I've written a small tool and located in the Tools-menu. It is just aligning the lables of the terminals, so there is no need for a front panel to show. However, I always get that flicker when it is called (FP opened automatically and closed programatically after the job is done). How to avoid this? Felix
-
Have you also considered just using a Somebody Else's Problem (SEP)-field? Would pretty much simplify everything (no need to move away, no bodybuilding to bash around with that heavy battery-bat). Felix
-
Filename too long in build
Black Pearl replied to crelf's topic in Application Builder, Installers and code distribution
Filename length of original is 262 Chars, without root its 259 and according to http://en.wikipedia.org/wiki/Filename 259 is exactly the limit. When the builder now creates a temporary backup (postfixing with *.llb~) it would exceed the limit. Can you try how many chars you need to reduce to get rid of the error? Felix -
Has someone made the Replace No Attributes method working in a version above 7.1? (I'm sure ther is an example out there). I don't have the newest versions, so I can't check browse the code of all the RCF-plugins. Can someone please post it as picture or snippet. Felix
-
Version 1.0.1
1,023 downloads
This is a toolkit to convert a state diagram designed with the editor dia into a LabVIEW state machine. Warning: This uses Scripting: So be aware of dragons, black holes, rusty nails and other monsters. I've only tested it in LV 7.1., got a crash every 2 hours... Bugs and workarounds in newer LV versions welcomed. Crashes in 8.5. Found the CAR (# 4CJFKTCS)). Edit: Fixed in V 1.0.1 Basic Operation *************** Create an uml Chart in Dia (it is OpenSource too). Compile it into a LabVIEW state machine (this will generate an enum based state machine with .vi and States.ctl for the TypeDefed Enum). Code the States. Getting started *************** * You will need to have several OpenG packages installed. Dependencies: appcontrol, file, variantconfig. In order to install these, you need to get the VI package manager from: http://jkisoft.com/vipm/download/ * For users of LV 7.x you need to get the TRefTraverse.llb from NI: http://decibel.ni.co...t/docs/DOC-5091 From 8.0 onward they are located under vi.lib\utility Propably you need to fix the linking from the main vi * You will need to download Dia: http://live.gnome.org/Dia Customizing *********** * In the Folder LV Scripting you will find the template 'State Machine Prototype Template.vit'. You can modify this within limits to change the state machine that will be generated. * There is a lot of Documentation with the Code: Check out the documentation folder with the 'Tree VIs' and the uml diagrams (they are surprisingly also made with dia) * If you have questions, ideas or found a bug, please do not hesitate to contact me! You can do so via PM on LavaG or via my private email on the BD of the About.vi V 1.0.1: * Fixed a bug in error handling (Error Handler Close.vi) * Workaround for the 8.5 crash * Support for changed Name of CaseSelect * Started to add support for StarUML Happy New Year -
Name: UML2LV State Machin Compiler Submitter: Black Pearl Submitted: 30 Dec 2009 File Updated: 03 Jan 2011 Category: *Uncertified* LabVIEW Version: 7.1 License Type: BSD (Most common) This is a toolkit to convert a state diagram designed with the editor dia into a LabVIEW state machine. Warning: This uses Scripting: So be aware of dragons, black holes, rusty nails and other monsters. I've only tested it in LV 7.1., got a crash every 2 hours... Bugs and workarounds in newer LV versions welcomed. Crashes in 8.5. Found the CAR (# 4CJFKTCS)). Edit: Fixed in V 1.0.1 Basic Operation *************** Create an uml Chart in Dia (it is OpenSource too). Compile it into a LabVIEW state machine (this will generate an enum based state machine with .vi and States.ctl for the TypeDefed Enum). Code the States. Getting started *************** * You will need to have several OpenG packages installed. Dependencies: appcontrol, file, variantconfig. In order to install these, you need to get the VI package manager from: http://jkisoft.com/vipm/download/ * For users of LV 7.x you need to get the TRefTraverse.llb from NI: http://decibel.ni.co...t/docs/DOC-5091 From 8.0 onward they are located under vi.lib\utility Propably you need to fix the linking from the main vi * You will need to download Dia: http://live.gnome.org/Dia Customizing *********** * In the Folder LV Scripting you will find the template 'State Machine Prototype Template.vit'. You can modify this within limits to change the state machine that will be generated. * There is a lot of Documentation with the Code: Check out the documentation folder with the 'Tree VIs' and the uml diagrams (they are surprisingly also made with dia) * If you have questions, ideas or found a bug, please do not hesitate to contact me! You can do so via PM on LavaG or via my private email on the BD of the About.vi V 1.0.1: * Fixed a bug in error handling (Error Handler Close.vi) * Workaround for the 8.5 crash * Support for changed Name of CaseSelect * Started to add support for StarUML Happy New Year Click here to download this file
-
Somewhere I read (can't reference) that you should NEVER let the message consumer enqueue elements on it's own message queue. There have been several designs of SM's which fall on this category of anti-pattern: Using arrays (that was even on NI if I remember correctly), queues and the event-queue. There is even a worse example in the LAVA 1.0 (and presented as very bad) of a 'SM' that had two stacks and push/put operations on them. I've previously fallen into this trap, so I stick with the simple SM's either using enums or strings. If they need to receive data/messages/events, they handle it in an 'idle' state. Or I use some kind of message handler (which originates from producer/consumer and not SM design), which never writes back on it's own queue. I think on a more abstract level, this anti-pattern allows to create a positive feedback and thus has the ability to get unstable (like exploding the queue, getting into an oscillating state or even chaotic state). But other than in other systems with instability (filter design, OpAmp's), I have no idea how to model such a system and 'prove' if it's stable or not. Felix
-
By chance found the following detail: Decoration.Text is of type Lable Refnum, and it is the same type as any Control.Lable.Reference returns. Felix
-
I found a general way to model the QSM, although it is impractical for description (but might be useful to remodel a QSM). Consider a simple state machine, with an dequeue element state. After every state it transits back to the dequeue state. From there it might transit to any other state depending on the queue element. From the modelling side, the queue is now a history data (remember the QSM architecture based on arrays?) and not part of the transition logic. Felix
-
Yair: We should have a more complex view on the GObj hierarchy. The Inheritance tree is easy to browse as you descriped and also documented in the help (ther is a image of the tree structure of the public classes). But some of the properties are references to other objects. Examples are Lable and 'Ring Text' (I wrongly refered to it as Ring, Ring Text is a Property of NamedNumeric, Hence also of Enum). These Objects are not creatable (we have Compositions, not Aggregations). These are also not part of the inheritance tree. We can identify these as they have a submenu in the property menu and have a reference there. Others like Position (and I believe the 'Text' we are looking into) are of type Type Def'd Cluster (or in C-Terminology it would be a struct). They do not have a reference to return. I'm still a bit unsure if there are different properties called text or a struct might be shown inline in the Menu if no other properties exist (Like the Decoration.Text Class). About the original problem, I fear that there is limited handling of User/Developer triggered Events/Actions (there are some Events for VI such as 'VI Activation'). But there are some helping properties to deal with it at the OS level, mainly I'm thinking about the BD.OSWindow property. There is a tool in the CR called 'Move Lable' which is using OS calls (Win) instead of scripting. If we can write down, what exactly we would expect to get, we should get that on NI's Idea Exchange, so at least they are aware about it. Depending on how scripting is managed now (after the semi-offical release), we might get a solution just hacked in by someone inoffically (as the complete interface was done before). Felix
-
Just inherit from the class to be used and make it singleton in the last step. In case of DMMs, you even can inherit two times from XX-DMM to make it XX-DMM1 and XX-DMM2 if there are two present in your system (they most propably will be connected differntly to your DUT or whatever you do with them. Felix
-
In my case, I did replace the Flatten/Unfalatten by a simple Type cast and it works the same (less real estate used). The main difference to your case is, that I travel down the class hierarchy (text is the inner part of string, ring is the inner part of all NamedNumeric's). But keyFocus seems to be as high as the general layer 'Control' in which the data container is embedded. From the errors I received, I guess that Diagram has not implemented whatever is necessary to pass the key focus to it's contents. Or does anybody have an example where you get some kind of Focus set on any BD-anything? Felix
-
Setting the width of ArrayConstant Element
Black Pearl replied to Black Pearl's topic in VI Scripting
Stupid me! Of course it is not dependend on the silly FP look on the BD. All I need is the access to the hidden properties. Now it works... Felix -
Setting the width of ArrayConstant Element
Black Pearl replied to Black Pearl's topic in VI Scripting
Next problem, how to link the enum to a type def? Any way I tried makes the enum look as normal BD enum and not as FP enum on the BD. Felix -
Setting the width of ArrayConstant Element
Black Pearl replied to Black Pearl's topic in VI Scripting
Got some of it working! Place a string control as vi obj class String Constant using Scripting on the BD. Type Cast the reference to String Control using Flatten to String/Unflatten From String (to more specific throws error). Now I can succesfully access the Size property of the String Control Class! Still need to check with arrays, enums... Felix Progress: Enums go as well. Will try arrays tonight... -
Got some time, so here the results. New VI object: style = string Control 1; vi obj class = String Constant (Decoration.Text does not work). To type cast the object, instead of to more specific class, I use Flatten To/Unflatten From String (works without errors). Now I have the reference as String Control. If I try to set the Key Focus I get Error 1058 'Specified property not found'. Felix
-
You need the variant to data type function to convert it to the original cluster when you read it. To get the ini file you described, use two clusters named Section 1 and Section two and the you need two write Cluster/Read Cluster. Felix
-
I was playing around a bit as your question is related to mine. Maybe the following might get you a bit further, as I can't continue right now: You can create a new String Control on the BD via scripting, but need to pass it as Decoration.Text (String Control from the Enum, Decoration.Text from the Type Specifier). Maybe this can be cast as String Control. If you set the Type Specifier to String Control, you get the error 'the BD is not able to hold that type'. To go into more detail how the controls are constructed: The Key Focus is part of the 'Control' (or was it 'String Control' ?), while nested inside you get String Control.Text which is the same as Decoration.Text. But I'm not sure how we can reach the container that contains the text and offers us the KeyFocus. I guess that owner is set by the New Object function. Other ways to explore, but I still have no hint where to start: The method of GObject CallClassOp, but I didn't find any call parameters searching on LAVA and NI. Even more of a hack would be (maybe it returns a parameter for CallClassOp) to get the binary of the String Control and look for any human readable text. Either we can dereference the Reference of the control (with some MemCpy things), use a hex editor to search the LV memory or we find it in an binary file (I did have a look at mesa.dll with wordpad with no positive results). Felix
-
Propably you can workaround by creating a mouse click on the appropiat location. But this would be heavy coding if you need to interface that via Win API (and not nice plattform independent code). Do we have some way to directly pass Mouse Events to LV? Felix
-
The two cases I face are: * An array of strings * An array of enums I would like to set a fixed width for both kinds of elements. I can do this in the editor (It doesn't work for enums alone, but if they are contained in an array container). My result so far: * Bounds, MasterRect, ... are all write only * Left of the array moves the array, but the right side as well * Element.Left does have no effect * With an FP string, there are 2 ways (Size and Text.Size), none of them available for a BD Constant. Create Constant and Change to Constant as well as Copy/Paste loose the size information. Felix