How can I detect when a sub vi finishes
Hi All,
I'm new to labview and would like some assistance.
I have produced a sub vi that generates 2 half sine wave of adjustable frequency and amplitude. These are cascaded to produce a number of cycles. These are all included in a case statement. The false state produces a dc output and the true state produces the sine cycles.
Before the button is pressed a dc level is output, when it is pressed a number of sine cycles are out and when they have finished the dc level should reappear.
I would like to know how to detect the completion of the sub vi in the true case so I can switch the case statement back to false asap.
I'm having problems with gaps in the output data when the sub vi teminates and the case statement reverts back to the false state.
Many thanks
Andy
Attachments:
PulseGeneration.vi 164 KB
HalfWaveBlock.vi 77 KB
Hello Andy
Thank you for getting in touch regarding your problem, I am an applications engineer at National Instruments and I will be supporting you with your query. As I understand you have a case structure which opens a sub vi, runs for a while and then changes back to its original state, and the problem you are having is switching from the vi execution case to an alternative case.
Thank you for sending in your vi's, I have been able to look at the HalfWaveBlock vi, but have not been able to open the pulse generation vi, could you send this again please? I can then look at your code and possible ways to implement the functionality.
There are a few options for approaching this task.
- Time the sub vi execution and add a timing condition to the case structure in your main code.
- Have a condition in the sub vi that alerts the main vi of completion.
I have also found some resources which will help you understand the functions you are using and will also give you some ideas for implementing further functionality.
- Execution Structures: http://zone.ni.com/devzone/cda/tut/p/id/12293
- VI analyser toolkit: http://zone.ni.com/devzone/cda/tut/p/id/5046
- Sub Vi indicator: http://digital.ni.com/public.nsf/allkb/26B1D8C3629475B686256DAD005816F6?OpenDocument
- Timing, Shift Registers and case structures: http://forums.ni.com/t5/forums/replypage/board-id/170/message-id/579608/tab/rich
There are also a number of examples available through the help tab and example finder window within LabVIEW itself. A few that I recommend looking at are.
- Dynamic Load Example.vi
- Dynamically Monitor VI
If you could look at these resources and send me your code, we can then both continue to work on a solution to this issue.
Regards
Stephanie L
Applications Engineer
National Instruments UK and Ireland
Similar Messages
-
How can I detect when a hibernate mode accures during my program?
hello everyone
I 'm trying to find some way to let my program know the moment when the user tries to get the computer into hibernate mode ?
is this possible in any way under java?Since you already know about JNI, and since you've already been told you can't do it in pure Java, what more are you waiting for? You might as well investigate the JNI route. The only other option I see is JNA.
-
How can I detect when a text field changes in Cocoa-Applescript?
I'm working on an application where I have one text field, and below it, a "Send" button. When the button is pressed, is sends whatever is typed in the field to all the user's Skype contacts. I have to prevent the user from sending a blank message to all contacts, so I have to change the button's setEnabled. I've been using an NSTimer to check every second, which works, but it lags my application hugely. Is there any handler that is run whenever text is added or deleted? Perhaps something like:
on myTextFieldDidChange_(aNotification)A specific text field is not used in the handler call - the delegate method is called for all text fields. In the case where you have several text fields, you can get the notification's object, for example:
on controlTextDidChange_(aNotification) -- a text field changed, so check it out
set thisTextField to aNotification's object() -- the current control being changed
set theText to thisTextField's stringValue()
log theText
-- whatever
end controlTextDidChange_
Note that you need to connect the text field's delegate outlet to your AppDelegate (or whatever class you are using for the delegate). -
How can I tell when a JEditorPane has finished loading the document?
Hi!,
I've got a JEditorPane connected to a viewport and a couple of scrollbars, and I realy need to know when the JEditorPane has completed loading the document, so that I can decide whether to turn on or off the scrollbars.
When I try to check the viewport.getView().getWIdth() right after calling setText() or setPage() the values come out wrong... is there an eventHandler that I can register ?
thanks in advance
-MiguelOK, I'm not an expert. But, why set the scrollbars manually? Would it not be easier to put the JEditPane in a JScrollPane with the scroll policy set to "as needed"?
Ken -
How can I tell when Firefox sync has finished?
I have completed the form with my name, password and phrase. The instructions say " go to the Tools menu, select Sync and look for a Last Update time." However, there is no Sync in the tools menu, just a set-up sync. If I click it It starts the signup procedure again and immediately tells me that my user name is already in use.
OK, I'm not an expert. But, why set the scrollbars manually? Would it not be easier to put the JEditPane in a JScrollPane with the scroll policy set to "as needed"?
Ken -
How can I detect a dialog and respond?
I'm having trouble doing something that's probably not that hard. I'm trying to "Print to PDF" a bunch of old AppleWorks documents. When you open a document created in AppleWorks v6 it opens right up, but when you open a document created in AppleWorks 5 you get a dialog box that says, "This document was created by a previous version of AppleWorks. A copy will be opened and "[v6.0]" will be added to the filename."
Right now I open the file and then:
tell application "AppleWorks 6"
activate
repeat while not (exists front document)
delay .2
end repeat
end tell
When the dialog box pops up, there's no front document so the whole thing freezes until you hit OK. How can I detect this dialog box and dismiss it?
Thanks
PS
When the box is open I ran this and got this result:
/usr/bin/osascript -e 'tell application "System Events" to get properties of windows of application process "AppleWorks 6"'
minimum value:missing value, orientation:missing value, position:436, 153, class:window, role description:dialog, accessibility description:missing value, focused:missing value, title:missing value, size:412, 123, value:missing value, help:missing value, enabled:missing value, maximum value:missing value, role:AXWindow, entire contents:, subrole:AXDialog, selected:missing value, name:missing value, description:dialog, minimum value:missing value, orientation:missing value, position:8, 76, class:window, role description:floating window, accessibility description:missing value, focused:missing value, title:Starting Points, size:631, 189, value:missing value, help:missing value, enabled:missing value, maximum value:missing value, role:AXWindow, entire contents:, subrole:AXFloatingWindow, selected:missing value, name:Starting Points, description:floating window, minimum value:missing value, orientation:missing value, position:4, 22, class:window, role description:floating window, accessibility description:missing value, focused:missing value, title:Button Bar, size:612, 51, value:missing value, help:missing value, enabled:missing value, maximum value:missing value, role:AXWindow, entire contents:, subrole:AXFloatingWindow, selected:missing value, name:Button Bar, description:floating windowHi,
The simplest would be to set the application preferences in the script.
Like this :
-- *** set prefs ****
tell application "AppleWorks 6"
activate
set oldPrefs to its preferences
copy oldPrefs to tPrefs
tell tPrefs
set old version warning to false --doesn't show the old version warning alert
set converted file suffix to true -- append “[v6.0]” to documents converted from older formats
set locked file warning to false
set paint reduction warning to false
end tell
set preferences to tPrefs
end tell
-- *** end set prefs ****
--**** your script, example ***
set tfiles to choose file with multiple selections allowed
tell application "AppleWorks 6"
repeat with i in tfiles
open i
tell front document
-- do something
end tell
end repeat
end tell
--**** end your script ***
-- *** reset prefs ****
tell application "AppleWorks 6" to set preferences to oldPrefs -
How can I detect a certain text within a field within CASE using IF
Dear all,
for a transformation / generation of values receiving from R/3 into BW I try to
manupulate three fields. I have a problem detecting a string in a field.
I am using a CASE with several WHEN clauses on one field. Depending on the
value, an IF is integrated. There I look into another field evaluating, if it contains
a certain string. E.g. IF STRING CP 'xyz' OR 'abc'.
System gives error for the locigal expression. I also tried CS, but same error.
How can I detect a certain text within a field and which is the right logical
expression.
Many thanks in advance!!!
ClaudiaHi,
Folow the blow example...
May be it helps....
DATA: hex1 TYPE string,
hex2 TYPE string.
hex1 = 'FFFF'.
hex2 = '123FF'.
IF hex1 CP hex2.
ENDIF.
Cheers,
SImha. -
Hello Everyone,
We all know whenever we try to connect to a PC which is not on network, we get UnKnownHostException etc..... by which we can detect that the corresponding PC is not an network(intranet/internet)
But when i send a msg from my PC to my PC, it works fine even if the network is down. I hv provided my PC's IP address instead of using localhost or 127.0.0.1 which reduces the possibility that the msg will not be traversed thru the network.
Any IDEA how this works.
Is There any possible way by which i can detect that my PC is not on network or the PC to which i'm trying to connect is not on network .......
Pls help me out, its really urgent as to be implemented in my Project
Thanks In Advance
Sahil ShaikhHello Surtee
I have developed a Messeging Service for the eCRM Apllication my company is developing and we r in the final stage of debugging.
Now whenever a user sends a msg to a PC which is not on network, the messaging service automatically sends an Offline mssg to that PC. But know i want ot distinguish wheather the PC to which i'm sending the msg is not on network or am I not on network based on this i need to perform diff. actions, hence i wanted to know that how can i detect .......
Pls see if u canhelp me out ......
Thanks
Sahil Shaikh -
How can we detect a virus on our mac?, How can we detect a virus on our mac?
We think we may have a virus from the USPS spam email. How can we detect a virus on our computer?
What makes you think there is a "virus"? Any symptoms...?
There are other types of malware (such as trojans) that can affect Mac OS X, but no viruses. A trojan would have to trick you into installing something (the malware) by making you think it is something else. You would be notified (by the system) that you are running a downloaded application for the first time, AND if something will be done to update your current system, you will be asked to authenticate (with your admin user name and password). If something like that comes up when you don't expect it, you should be suspicious (and NOT authenticate). Just opening an email won't do anything, even if it's an email that may affects Windows PCs.
This free utility can scan your Mac for malware.
http://www.clamxav.com/
Apparently, there is a version on the Mac App Store.
http://search.itunes.apple.com/WebObjects/MZContentLink.woa/wa/link?path=mac%2fC lamXav
In the past, when I bothered to run it a few times a year, the only things it found were junk emails that I had not bothered to delete with embedded malware, all of it aimed at Windows PCs. -
How can I detect that there is an internet connection?
How can I detect that there is an internet connection?
Peter GoossensHow can I detect that there is an internet connection?
Peter Goossens
Peter,
You might want to experiment with this. It's not perfect, but...
Class
Imports System.IO
Imports System.Net
Namespace InternetConnection
Public Class SiteInfo
Private _displayName As String
Private _connectionString As String
Private Sub New(ByVal name As String, _
ByVal connectionString As String)
_displayName = name.Trim
_connectionString = connectionString.Trim
End Sub
''' <summary>
''' Gets the connection string of this instance.
''' </summary>
''' <value></value>
''' <returns></returns>
''' <remarks></remarks>
Public ReadOnly Property ConnectionString() As String
Get
Return _connectionString
End Get
End Property
''' <summary>
''' Gets the display name of this instance.
''' </summary>
''' <value></value>
''' <returns></returns>
''' <remarks></remarks>
Public ReadOnly Property DisplayName() As String
Get
Return _displayName
End Get
End Property
''' <summary>
''' A method which will add a new site to your collection of SiteInfo.
''' </summary>
''' <param name="siList">Your generic List(Of SiteInfo).</param>
''' <param name="displayName">The display name for this new instance
''' of SiteInfo.</param>
''' <param name="connectionString">The connection string for this
''' new instance of SiteInfo.</param>
''' <remarks></remarks>
Public Shared Sub AddNew(ByRef siList As List(Of SiteInfo), _
ByVal displayName As String, _
ByVal connectionString As String)
Try
If siList Is Nothing Then
Throw New NullReferenceException("The collection of SiteInfo cannot be null.")
ElseIf String.IsNullOrEmpty(displayName) OrElse displayName.Trim = "" Then
Throw New ArgumentException("The display name cannot be null or empty.")
ElseIf String.IsNullOrEmpty(connectionString) OrElse connectionString.Trim = "" Then
Throw New ArgumentException("The connection string cannot be null or empty.")
Else
If siList.Count > 0 Then
Dim findDuplicate As IEnumerable(Of SiteInfo) = _
From si As SiteInfo In siList _
Where si.DisplayName.ToLower.Replace(" "c, "") = _
displayName.ToLower.Replace(" "c, "") AndAlso _
si.ConnectionString.ToLower.Replace(" "c, "") = _
connectionString.ToLower.Replace(" "c, "")
If findDuplicate.Count <> 0 Then
Throw New ArgumentException("This is a duplicate entry.")
Else
siList.Add(New SiteInfo(displayName, connectionString))
End If
Else
siList.Add(New SiteInfo(displayName, connectionString))
End If
End If
Catch ex As Exception
Throw
End Try
End Sub
''' <summary>
''' A method which will return a boolean value to indicate internet
''' connection status.
''' </summary>
''' <param name="siList">Your generic List(Of SiteInfo).</param>
''' <param name="displayName">The display name for the instance
''' of SiteInfo to use.</param>
''' <returns></returns>
''' <remarks></remarks>
Public Shared Function InternetIsConnected(ByVal siList As List(Of SiteInfo), _
ByVal displayName As String) As Boolean
Dim retVal As Boolean = False
Try
If siList Is Nothing Then
Throw New NullReferenceException("The collection of SiteInfo cannot be null.")
ElseIf siList.Count = 0 Then
Throw New ArgumentOutOfRangeException("Count", "The collection of SiteInfo cannot be empty.")
ElseIf String.IsNullOrEmpty(displayName) OrElse displayName.Trim = "" Then
Throw New ArgumentException("The display name cannot be null or empty.")
Else
Dim findInstance As IEnumerable(Of SiteInfo) = _
From si As SiteInfo In siList _
Where si.DisplayName.ToLower.Replace(" "c, "") = _
displayName.ToLower.Replace(" "c, "")
If findInstance.Count <> 1 Then
Throw New ArgumentException("This instance is not in the collection of SiteInfo.")
Else
retVal = TestConnection(findInstance.First.ConnectionString)
End If
End If
Catch ex As Exception
Throw
End Try
Return retVal
End Function
Private Shared Function TestConnection(ByVal url As String) As Boolean
Dim retVal As Boolean = False
Try
Dim request As WebRequest = WebRequest.Create(url)
Using response As HttpWebResponse = DirectCast(request.GetResponse, HttpWebResponse)
Using dataStream As Stream = response.GetResponseStream
Using reader As New StreamReader(dataStream)
Dim responseFromServer As String = reader.ReadToEnd()
retVal = True
End Using
End Using
End Using
Catch ex As WebException
retVal = True
Catch ex As Exception
retVal = False
End Try
Return retVal
End Function
End Class
End Namespace
Example Usage
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles MyBase.Load
Dim siList As New List(Of InternetConnection.SiteInfo)
InternetConnection.SiteInfo.AddNew(siList, _
"Test1", _
"http://dev.virtualearth.net/REST/v1/Locations/37221?o=xml")
InternetConnection.SiteInfo.AddNew(siList, _
"Test2", _
"nothing here")
InternetConnection.SiteInfo.AddNew(siList, "Test3", _
"www.google.com")
InternetConnection.SiteInfo.AddNew(siList, "Test4", _
"http://fls-online.com")
' This will return true:
Dim bool1 As Boolean = _
InternetConnection.SiteInfo.InternetIsConnected(siList, _
"Test1")
' This will return false:
Dim bool2 As Boolean = _
InternetConnection.SiteInfo.InternetIsConnected(siList, _
"Test2")
' This will return false:
Dim bool3 As Boolean = _
InternetConnection.SiteInfo.InternetIsConnected(siList, _
"Test3")
' This will return true:
Dim bool4 As Boolean = _
InternetConnection.SiteInfo.InternetIsConnected(siList, _
"Test4")
Stop
End Sub
End Class
Let me know your results please?
Still lost in code, just at a little higher level. -
How can I detect if I'm running a compiled versione of my application?
In my application I have included some special functions I don't want my customer to use. Since I will distribute the application as an .exe file, instead of cutting away those functions before releasing the .exe, I want to hide them when the application is runnig as an executable, and leave them active when running in the LV environment.
How can I detect if I'm running an executable or the LV environment? Do I have to scan the application name until I find an .exe different from labview.exe or there is another way to obtain the flag (something similar to CVI function InStandaloneExecutable() for example)?
Roberto
Proud to use LW/CVI from 3.1 on.
My contributions to the Developer Zone Community
If I have helped you, why not giving me a kudos?An application property exists:Application:Kind
with the following values: Development System, Runtime System, Student Edition, or Embedded LabVIEW.
greetings from the Netherlands -
How to restore my ipad?My ipad say on screen CONNECT TO ITUNE.How can i do when i connect with computer.It is need itune new version.Can you sent me.I will be waiting your answer.Please help me sir.
Check for Updates.
http://i1224.photobucket.com/albums/ee374/Diavonex/Album%208/78d42b19fa42e8d83b5 5a65e1333373f_zpsf58bbe10.jpg -
How can I deactivate when Acrobat Pro XI wont load?
I installed a purchased upgrade of Acrobat Pro XI on this computer but all I now get is a screen headed 'Sign in Required' inviting me to register my trial version but providing no links to do so.
Much of Acrobat XI Pro did not work.properly but Adobe tells me I don't have sufficient memory despite the required 1GB being installed.
An unsatisfactory product from a company now difficult to contact by email that hides behind an unhelpful 'Help' desk in India staffed by non-proficient English speakers incapable of providing any answers not on their crib sheets.
I am directed here to get a user to do Adobe's work.
What follows indicates Adoobe sens emails from non.valid addresses.
Mail System Error - Returned Mail
From: Mail Administrator <[email protected]> | Date: 25/09/2013 3:47 PM | Email
To: John Face<[email protected]> View message details
Attachments: Part_0 (350b) (350b)
This Message was undeliverable due to the following reason:
Each of the following recipients was rejected by a remote mail server.
The reasons given by the server are included to help you determine why
each recipient was rejected.
Recipient: <[email protected]>
Reason: No such user - psmtp
Please reply to <[email protected]>
if you feel this message to be in error.
Causes nothing but problems.
Just posted on your forums
3:39 PM 25/09/2013
http://forums.adobe.com/post!input.jspa?containerType=14&container=4714
How can I deactivate when Acrobat Pro XI wont load?
I installed a purchased upgrade of Acrobat Pro XI on this computer but all I now get is a screen headed 'Sign in Required' inviting me to register my trial version but providing no links to do so.
Much of Acrobat XI Pro did not work.properly but Adobe tells me I don't have sufficient memory despite the required 1GB being installed.
An unsatisfactory product from a company now difficult to contact by email that hides behind an unhelpful 'Help' desk in India staffed by non-proficient English speakers incapable of providing any answers not on their crib sheets.
I am directed here to get a user to do Adobe's work.
http://forums.adobe.com/thread/1303366
From: Adobe <[email protected]>
To: [email protected];
Subject: Reuse content making tedious work easier
Stop retyping and start reusing.
See how
>>http://www.adobe.com/au/campaigns/acrobat-xi-content-reuse.html?trackingid=KIKZR
Read online
>>http://click.mail.adobesystems.com/?qs=1fdac03698836d3f227a6f8e4faefabc020ad712061d8f58583 a1aeff2e2ddc999d80757db497536
--=----=----=----=----=----=----=----=----=----=----=----=----=----=--
Adobe(R) Adrobat(R) XI
--=----=----=----=----=----=----=----=----=----=----=----=----=----=--
Stop retyping and start reusing. Acrobat XI puts an end to the
busywork when it comes to repurposing PDF file content.
See how
>>http://www.adobe.com/au/campaigns/acrobat-xi-content-reuse.html?trackingid=KIKZS
It?s a breeze to reuse what you need from PDF files with Acrobat XI.
When you need to grab important content from inside a PDF or reuse the
whole thing, Adobe(R) Acrobat(R) XI software makes it easy to convert
PDF documents to Microsoft Word, Excel, and PowerPoint?with no
retyping and minimal reformatting.
As simply as saving a file, you can get just what you need and get
back to more important work.
See how >>
>>http://www.adobe.com/au/campaigns/acrobat-xi-content-reuse.html?trackingid=KIKZT
PC magazine Editor's choice 2012
--=----=----=----=----=----=----=----=----=----=----=----=----=----=--
#Acrobat
>>http://twitter.com/search?q=%23acrobat
--=----=----=----=----=----=----=----=----=----=----=----=----=----=--
PCmag.com Editors' Choice logo is a trademark of Ziff Davis, Inc.
Used under license.
Adobe, the Adobe logo, the Adobe PDF logo, and Acrobat are either
registered trademarks or trademarks of Adobe Systems Incorporated in
the United States and/or other countries. All other trademarks are the
property of their respective owners.
(C) 2013 Adobe Systems Incorporated. All rights reserved.
This is an advertising message from Adobe Systems Pty Ltd, its
affiliates and agents ("Adobe"), Tower 2, Level 27, 201 Sussex Street Sydney,
New South Wales, 2000, Australia.
If you'd prefer not to receive email like this from Adobe in the
future, please click here to unsubscribe. Alternatively, you may
mail your unsubscribe request to:
>> http://click.mail.adobesystems.com/?qs=1fdac03698836d3f1ad59e785d5dc693562fd9325ddedc06b18 2523889dab970e16f0296df7a4a18
UNSUBSCRIBE
>> http://click.mail.adobesystems.com/?qs=1fdac03698836d3f1ad59e785d5dc693562fd9325ddedc06b18 2523889dab970e16f0296df7a4a18
Adobe Systems Pty Ltd
Tower 2, Level 27, 201 Sussex Street
Sydney, New South Wales,
2000,
Australia
Attn:
Field Marketing Department
Your privacy is important to us. Please review Adobe's online Privacy
Policy by clicking www.adobe.com/au/privacy.html (Australia)
>>http://www.adobe.com/au/privacy.html
www.adobe.com/nz/privacy.html (New Zealand)
>>http://www.adobe.com/nz/privacy.html
For customer service issues please visit our web site at
www.adobe.com/go/supportportal or call (AUS) 1 800 614 863 or (NZ) 0
800 485 948 for more information.
>>http://www.adobe.com/go/supportportal
General enquiries about Adobe
communications:[email protected]
>>mailto:[email protected]
If you have a complaint, send it to:[email protected]
>>mailto:[email protected]
This email has been sent to [email protected]
Message was edited by: OQOroger to indicate Adobe uses invalid addresses to customers who have already purchased the subject productYou can refer to :
Acrobat Learn & Support
Installing, uninstalling Acrobat X | Mac OS
Adobe Acrobat X Pro * Activation and registration
http://www.adobe.com/content/dam/Adobe/en/accessibility/products/acrobat/pdfs/acrobat-xi-p ro-accessibility-best-practice…
They are useful resources.
Regards
Rajshree -
On IOS 7, how can you tell when your battery is charging for your phone?
on IOS 7, how can you tell when your battery is charging for your phone?
thanks everyone=you all helped.
I wasn't used to not getting the 2 sided plug- now I know I am ok>
**hugs** -
How can i see when someone has accessed my call/text log. (This is possible on google/gmail) I have been informed that someone has accessed my activity log and is giving my information to a third party. I believe it is a service tech, but I am not interested in persuing that further. I just need to see when my account has been accessed if possible.
Hi lynniewigs,
This is a common concern among Android and I-phone user, and one of the drawbacks to using a smart phone. We lose so much privacy. Our phones become cameras into our homes for us to be spied on.
I don't know what type of phone you have, if it is even a smart phone, but here is an example of an application that you can use to determine which applications are accessing your information and sending it out.
Permission Scanner - Android Apps on Google Play
Google just recently revamp their permissions geared to hide invasive applications that spy and send out your information without your knowledge. Report says be aware of what your Android app does - CNET
Please continue to be mindful of the apps you download and the permissions you give.
Maybe you are looking for
-
Delete score in vendor evaluation
Hi, everyone! How can i delete vendor evaluation score for delivery? After make evaluation, I delete a good reciept document (cancellation), so now I don't have movement document for this vendor. If i make new vendor evaluation old score doesn"t cha
-
Hi All, I have got the error when searching document limited by size. We did search, displays the results, click on search options, in the predefined properties select Size and enter value say GT 100 MB. I would expect to display files which is great
-
Perfromance tunning with StatsPack
I am checking my statspack report & seeing this digit can any body tell what it mean? Execute to Parse %: 34.82
-
Problem starting a scenario from Unix command line
Hello all, many apologies if this is the wrong section of the forum, if it is and you could direct me to the right section I'd be grateful. If you're still reading and I am in the right section, I have a problem when using the startscen.sh script to
-
Java.rmi.RemoteException: HTTP Status-Code 404 Not Found securesimple/Ping
Hello! I'm testing interop and simple application for JWSDP and I get the following error in the context: build-client: run-sample: [echo] Running the simple.TestClient program.... [java] Service URL=http://localhost:8080/securesimple/Ping [java] Nov