LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Safety lock for the controll button

can someone explain the working of this solution?

Screenshot (8).png

0 Kudos
Message 1 of 8
(1,268 Views)

The code runs from left to right. The Voltage Source is first disabled (its "Disabled" property is set to Disabled, user can't edit it) and then repeatedly (in while structure), user is asked for a password. Actually he is asked only after he fires the event in the event structure (after UNLOCK button press). If the password is equal to 123456780, the "Disabled" property is set to Enabled.

0 Kudos
Message 2 of 8
(1,210 Views)

Hi,

 

I guess clicking the "Unlock" button will show a pop-up asking the user to enter the password "123456780" to unlock (= enable input) the Voltage Source control, which was initially locked (= disabled for input).

 

Regards.

0 Kudos
Message 3 of 8
(1,249 Views)

Well, we can make some assumptions about the picture.  But there is more code hidden than shown.  So, assuming:

  • The True case enables the same control 
  • There is an Event case for the STOP Button that outputs a True to the tunnel 
  • The Express VI is configured with no real surprises
  • The Boolean Mechanical actions are appropriate 
  • The string constant display style is normal

None of those assumptions can be verified from a PICTURE! so please, post a code capture or a snippet or attach the VI.

 

The "Solution" is a silly way to prompt the user for a string whenever the control with no name's value is changed.  The user input string from the prompt is compared to a constant value of "1234567890" to select the case (Silly, the cases could be "1234567890" and Default the comparison is extraneous)


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 8
(1,240 Views)

@Chirag4646 wrote:

can someone explain the working of this solution?

 


If it might be "working", it is probably not a reasonable "solution" to whatever you are trying to do. Who wrote it? Where did you find it?

If it is not your code, you need to give us a link to the previous discussion or to wherever you found this.

 

As has been said, (most of the time) we cannot tell much from a picture, except that whoever wrote this code is probably a beginner and not very familiar with LabVIEW programming, because there are glaring problem, the first is having an event associated with a control that has no label! Having a "password" as plain diagram constant lets anyone with a hex editor crack it within seconds. Pointless. The sequence structure is not needed if coded correctly.

 

There is way too much duplicate code! I assume that in the FALSE case, the control gets disabled, so why is the property node not after the case structure? Why do we even need a case structure if a "select" would be sufficient? Only one instance of the property node needed! Why is the error diagram constant "handmade"  instead of nicely aligned fresh from the palette?

 

What's in the other event cases? What is the purpose of the code? How does it fit into the rest of your {hopefully more interesting) project?

 

0 Kudos
Message 5 of 8
(1,198 Views)

@VitSlaby wrote:

The code runs from left to right.


Execution order is completely determined by dataflow alone. In this case it is forced by the pointless dangling error wire that never really used to carry any useful information.

 

Left and right has no real meaning and in this case you are only correct if the specific button is pressed after the Vi is run and the visible event fires for the first time, then in goes back (right-to-left!) to the even structure due to the while loop.

0 Kudos
Message 6 of 8
(1,185 Views)

thanks for the replay, I want to know the working of this code  

 

Link: https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000fz38SAA&l=en-IN

0 Kudos
Message 7 of 8
(1,159 Views)

@Chirag4646 wrote:

thanks for the replay, I want to know the working of this code  

 

Link: https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000fz38SAA&l=en-IN


Did you read the explanation in the link? The code is written in LabVIEW and very simple. If you don't understand LabVIEW, it is pointless to explain further so I recommend to start with the learning resources listed at the top of the forum.

 

Do you have any specific question about this program? What part don't you understand?

0 Kudos
Message 8 of 8
(1,150 Views)