-
Posts
161 -
Joined
-
Last visited
-
Days Won
3
Content Type
Profiles
Forums
Downloads
Gallery
Everything posted by SteveChandler
-
Wouldn't it be cool if the specific dynamic dispatch icon and wire appearance were displayed in highlight execution? http://forums.ni.com...n/idi-p/1533634
-
You are still waiting? Didn't you take the exam with John? Other people who took the exam, how long did it take to get your results?
-
LapDog Messaging Library v2 Beta 1 is available!
SteveChandler replied to Daklu's topic in Announcements
I actually wouldn't mind helping on some of it. There are a couple of problems though. One is time. The other is that I don't know if my company would be ok with it even on my own time since they own the software. But I will definitely check into it. But that leaves the first problem. -
LapDog Messaging Library v2 Beta 1 is available!
SteveChandler replied to Daklu's topic in Announcements
I really like the Data-less messaging. I know it is still beta but the vi documentation is missing. For the final version it would be useful to include examples. VIPM shows a dimmed out open examples button. -
Another Lego Mindstorms NXT Rube Goldberg Machine
SteveChandler replied to crelf's topic in LAVA Lounge
Because he can't afford more? -
I think that the day will come when snippets can include subvis. Maybe someone will create a browser plugin that lets you navigate the code. I hereby promise in a public forum that I will buy a beer for the first guy who makes a browser plugin that lets me edit the code. Heck I will buy you a SIX PACK if you do that.
-
1. I use snippets only for posting or importing example code on the forums. 2. Hard to say. Sometimes a couple a day, sometimes a few weeks without creating one. But maybe five a month or so. 3. My snippets are organized in threads on the forums
-
Well I am familiar with them for what it's worth But I think I will probably just dig in and create one for fun.
-
Hmm, guess it's time to finally start learning about xcontrols then.
-
I have been looking at the sample CLA solution which has an XControl. You are not really expected to create an XControl are you?
-
Class Property Nodes confusion
SteveChandler replied to bsvingen's topic in Object-Oriented Programming
I think the point of class property nodes is intended to replace read/write vis. They are kind of a strange invoke node. I would think that they will stay just like they are since changing this would break lots of peoples code. -
I think the point is about the representation of the bits in a meaningful way to us humans. I completely agree that the difference between dataflow and everything else is huge! But dataflow and parallelism can be unintuitively implemented in any text based language. They are obviously much more difficult to see at a glance. But I think the philosophical principle of Linguistic Relativity applied to programming languages is more interesting than what happens after the compiler gets done with the code.
-
If you feel like giving some ribbing positive feedback you can quote Alfred Whitehead on the importance of a good notation. He could have been writing about LabVIEW instead of mathematics. Of course any programming language is a graphical language at least to the extent that it uses math. The meaning of the four glyphs "40+2" is the same in English, Chinese, Russian and French. LabVIEW just takes this to a higher level. When I am programming in some text based language I often wonder how much more difficult (or at least inconvenient) it must be for someone who does not speak English to use that programming language
-
If you create a Strings[] property node from your combo box just right click on the input and create constant. Sorry but I forgot to mention that clearing the strings does not clear what is displayed so you also have to write an empty string to the Value property. To keep the write from happening at the same time as some other code you have to enforce dataflow with the error wire.
-
The documentation seems to be wrong. I just tried this on a single monitor system and the property returned 1. I tried on a two monitor system and the property returns 1 for the primary monitor and 2 for the secondary monitor. I only have LV2010.
-
An event case can handle multiple events. right click to edit events handled by this case. At the bottom left there is a blue + to add additional events. Another way to do it with two event cases if you are using the producer consumer is to simply have both cases send the same message to the consumer.
-
Just write an empty string array to a stings [] property node in the start of your program.
-
IPE Structures and anonymous cluster elements
SteveChandler replied to mje's topic in LabVIEW General
I don't see how that would work. If it is not named you have no way of specifying the element you want to unbundle. But it will work for clusters that are partially anonymous. Or you could do this This is not specific to the inplace element structure. There is no way to unbundle a single element of a cluster unless it has a name anywhere in LabVIEW. -
Yea I knew about that. But John made it sound like there were some new options like giving presentations at NI week. If that was some kind of irony it went over my head. I think what he was getting at is how to stay sharp and preparing presentations for NI week is a good way to do that. I'm pretty slow but I think I understand wat he was saying now
-
Congrats! What are the new options for maintaining your CLA? I can't seem to find anything about that. I am going to give the CLA a try. Not that I think I have much of a chance but I have a couple months left on my training membership so I might as well at least see what it is like.
-
I did not use a state machine anywhere. An "enumerated typedef constant" . First an enum is a collection of integers that have strings associated with their values. You can find the enum control under Ring & Enum. You right click and select edit items. You can wire that to a case structure and switch on the name instead of remembering the number. You can right click the case structure and add a case for every value. Now you will have a case for each element of the enum. One reason you would want to use a number instead of just a string (an enum is a number) is that a number takes much less memory. But more importantly you can also ensure that only values in the list can be used. Somebody could not try to add a "Grape" case because it does not exist in the enum. If you right click on the enum terminal and create a constant you have an enum constant. Now for the typedef part. You can create your own custom controls in LabVIEW. That is what the .ctl files in the project are. You can make a custom control from the enum by right clicking on the control, selecting advanced, then customize. When you save the ctl file you have three options: "Control", "Type Def" and "Strict Type Def". If you save it as a control then you can easily place the enum on the front panel again by just dragging it there. Now you don't have to add all those items if you want to use this in twenty places in different subvis. The other option would be to copy and paste the enum. But what happens if you have a vi that has ten of your enum constants and you decide you want to add grape? You have to right click on each constant and edit the items. Not only that but you have to make sure that the numbers match the strings in each instance. Remember that the datatype is not a string but a number. The string is associated with the number. That means you can do any numeric operations on the enum. In the example above banana+orange=pear because banana is associated with the value 1, orange is associated with 2 and pear is associated with 3. If you do not keep all the constants consistent and have one instance where the value 1 is associated with banana and in another the value 1 is associated with pear you will have problems. That is where the typedef comes in. When you save your custom enumerated control as a typedef, then anywhere it is used, either as a control, indicator or constant, they will all be updated when you edit the control. A strict typedef is the same thing as a typedef but it makes sure that all properties get updated when you edit the strict typedef. The project I attached uses strict typedef clusters for your front panel. If you want to change the color just open the .ctl file and edit it. You can also add to the clusters and the cluster constants in your code will be updated. That means that unbundle by name will not break. The error terminal is a built in typedef cluster. The comm.vi is an action engine that uses an enumerated typedef (Comm Command.ctl) for the command. It has the values "initialize", "Write and Read" and "Close". If you wanted to add another command such as "Reset" you would add that by opening the .ctl file, right click and edit items, insert the new command and save the file. The action engine will be broken. If you click on the run arrow you will see that this is because the case structure does not have a case for the new value and there is not a default case. You can right click on the case structure and select "add case for every value"
-
Do you mean the difference between your program and the one I posted or the difference between what gcocde posted and the one I posted? The difference between yours and mine is that in mine the communications are all done outside of the user event structure. You mentioned that your front panel would freeze. That will happen if the VISA read is taking a long time in your event structure. The difference between mine and the one that gcode posted is that his uses events for error signaling. I know the producer/consumer architecture seems more complex than it needs to be but there are significant advantages which is why others have been suggesting this to you. But it really is not that complex once you get to know it. This link has some good information for you.
-
This will get you started. It does not have a user event to keep it simple. I integrated some of your code but you will have to add the missing functions. If you study this code and understand how it works you should have no trouble doing the rest. The Comm.vi is a simple action engine. Also study gcode's project template. You will probably want to do some better error handling especially when dealing with comm ports and the fact that your device may or may not even be on. The error module in that project will work very well for you. I have no way of testing this but maybe something will happen to your device. I hope that something does not involve smoke! Controller.zip
-
User events are events you generate in your code. In a standard producer/consumer design you can send messages from the producer to the consumer. But there is no way to send messages from the consumer back to the producer. This can be necessary if there is an error in the consumer and you want to notify the producer. A user event is much like a queue. The difference is that with a queue you can send from multiple loops to only a single loop whereas a user event can be sent to multiple loops. That detail doesn't matter right now. For sending messages from the consumer loop back to the producer you could also just use another queue but many examples use a user event. You use LV8.5 right? I will create an example with some of your code in it to get you started. Why would I do this? I like the practice! It can be hard to come up with an idea just for practice. And if it helps someone all the better.
-
The program is simple enough. If I can find some time I would be happy to set it up into a producer/consumer design pattern. But I have a couple of questions. Forget about the architecture for now. If I were to help you with this I need to know if you are familiar with the following concepts. clusters, bundle and unbundle by name (I see you are unbundling the error wire by name) queues typedefs custom controls user events (different from the events you are using) subvis action engine/functional global state machine Until I can get some time to help get you started you should study those things above that you do not understand. You have an event for Timing/Phase shift value change. You create a command to send to your controller from that and read a response. You then write that back to the Timing/Phase shift control that triggered the event. You do the same for some other controls. Is it your intent that the controller modifies what the user enters into those controls?