Only 1 VI can run at the same time?

Hi there, this is for my school project which requires to acquire analog input from 2 sensor circuits(1 with LDR,1 with LM35 for temperature sensing) and generate an output so that a light bulb would light up if the voltage in the LDR circuit is too low and a fan would be turned on if temperature is over a certain limit.
I managed to come up with the VIs and it worked independently but when i try to integrate it only the LDR circuit worked, and i could not troubleshoot it.
Attached is the 2 VIs that i come up with and another VI which i tried to integrate but failed to work properly.
Thanks
Solved!
Go to Solution.
Attachments:
VaryingFan.vi ‏40 KB
VaryingLight.vi ‏35 KB
2VIs.vi ‏58 KB

You need to create a DAQmx task to be able to read two voltages from two AIs on the same device.  Same for writing two AOs on the same device.  Here is an example of how to create a DAQmx task.  Create one task for AI and another for AO.  You must set the AI Read and AO Write to Multiple Channels - Single Sample - 1D DBL.  The first element in the 1D array will correspond to the first element in the List of AI Channels array shown in my example:
Here is another tip.  On the loop borders, change the DAQmx task/channel in/out and the error in/out terminals to shift registers.  Using shift registers here is good practice recommended by NI.  The reason being is this.  If there happens to be an error in one loop iteration, the error gets lost with regular terminals because the input terminal will have no error condition.  On the next iteration, the error from the previous iteration is lost.  For the task in/out terminal, if the task changes, you will lose the change.  Shift registers will propogate all errors and changes to the next loop iteration.  Another reason is if the loop runs 0 times (doesn't run at all).  The outputs will be default values.  So if there was an error coming into the loop, it will be lost if the loop does not iterate at least one time.  So use shift registers here.
One more thing, change your numeric type to DBL inside your case structures.  Notice the coercion dot (small red dot) on the input to the DAQmx Write funtion.  It is expecting a DBL data type.
OK, just one more.  Your output from AI Read is a DBL data type.  You can't have a DBL input to a case selector.  Notice again the red dot on the case selector question mark.  Labview is converting the DBl to an integer (probably an I32).  You may have rounding off errors.  You should round off and change to an integer before the question mark so you know exactly what the outcome will be.  What if the AI Read outputs 0.5 votls?  Will the 0 case be executed, or will it be the 1,2 case?  What if the voltage is 2.5?  Which case will be exectuted?  You should fix this.
I think that is enough for now. 
- tbob
Inventor of the WORM Global

Similar Messages

  • How many threads can be running at the same time

    Hi!!
    Dows anyone knows how many Threads can be running at the same time in the JVM.
    I'm making a multi thread client-server app and I would like to know how much simultneous connections the JVM support. I'm using one Thread per connection.

    Hi, thanks to all for your answers.
    I think that I made the wrong question, as you said: "that means the number of threads currently created".
    I'm worry about this because my application is already online (It's a mail server -SMTP and POP3 server using ORACLE for the users database- ) and some other user post in the "multi-tread forum" that almost any JVM can only have 700 threads created at the same time, and I've never heard or read anything about this.
    what you mean with the stack space (memory??)
    I'm using the JavaWebServer 2.0 and a servlet to start the main Thread.
    Again Thanks to all for the answers but I think that the schapel answer is the one that solve my doubt...

  • Can a vodcast and a photocast run at the same time ?.

    Hi,
    I would like have a video podcast play and a photocast run at the same time is this feasible?
    Geoff

    Since they're different apps and there's no way to sync something like that: no. Sounds like you could just do a video slideshow to me. That's supported by all major video creation apps.
    -S

  • Multiple Libraries for Video running at the same time on one PC

    Hi Everyone -
    I want to clarify this is for VIDEO files, not music for my 6 ATV's on the network.
    Problem: I have well over 1000 VIDEOS in my iTunes Library, and I am wanting to have multiple libraries availible at the same time; not just whichever the computer has open.
    We have several atv's on the network and I would like to take my video organization one step further; instead of scrolling forever in the atv menus for the video you want; I could make several libraries all availible at the same time. 
    Such as:
    Kids Library
    Workout Library
    Parents Library
    etc
    This in turn would shrink the primary library and have less videos to sort by.  I know how to create the Libraries, I just dont know how to have them all running at the same time.
    Infastructure:
    Windows 7 Ultimate with Drobo B800FS (16TB of storage) all connected to Cisco 3660 Gig switch with multiple atv's hardwired back.

    iTunes can only open one library at a time. If you have multiple computers, or virtual machines, each could be serving a different library.
    tt2

  • FRM: 10270 Cannot attach the library when two forms run at the same time

    I get the error message FRM: 10270 Cannot attach the library SYSLIB while opening menu BMENU but only when i try to open a second form while the first form is still running.
    Both forms are working fine as long as they ar not running at the same time.
    It seems like the second form opening does not have access to the FORMS60_PATH, because you can not open a third form because it can't find it.
    All the forms anf libraries (plx)is in the FORMS60_PATH.
    I am running developer_6i forms & reports on a HPUX 11i machine and I am trying to access them through jinitiator 1.3.1.9 on a XP machine.
    Best regards
    Macke

    Thanks a lot for the tip. I used truss and realised that it found the library but was not allowed to open it. The kernel parameter maxfiles was set to low.
    I increased it and everything works ok
    BR
    Marcus

  • Two Telnet read VI's running at the same time interfere with each other

    I have a situation where multiple tests must test multiple UUT’s on the same computer. To send commands to and get responses from the UUT's I use a telnet session. The telnet read VI uses a semaphore. Therefore when two separate top level VI's are running, each calling the Telnet read VI, if one Top Level VI is using the Telnet Read VI the other Top Level VI waits for the first one to complete before it can use the Telnet Read VI. This VI is setup for reentrant execution but because of the semaphore it cannot truly be used as a reentrant function. This causes severe problems when trying to communicate with two different telnet sessions simultaneously.
    In the past I have avoided this problem by compiling everything into an executable. Then each Top Level program runs completely independently with no interdependences. However, now I am implementing Teststand and I need to call the same Top Level VI's. I need to be able to get information into them and back out of them from Teststand. This means that I can no longer compile them into stand alone executables. I did compile each top level VI into its own Share DLL thinking that then each top level program would have its own library to call upon. This did not work. Even though both top level programs are compiled into their own DLL there is still interdependency when calling the telnet read VI. One program waits for the other to finish reading from its telnet connection before it can read from its own telnet connection. Since I have to continuously read from the telnet connection, sometimes for up to half and hour, the tests do not function simultaneously. How can I get around this? Is there a solution?
    Josh
    PS The Telnet Read VI I am refering to came with the Internet Toolset package. Attached is a copy of the VI I use to communicat with the UUT's.
    Attachments:
    GUI_Telnet_W-R_Auto.vi ‏64 KB

    Sorry about the confusion.
    The file I attached is in the hierarchy of two separate top-level VI's. The telnet connect is opened once and closed once in each top-level program. The ref number is then passed into and out of the VI that I attached. I use this VI to repeatedly send commands via telnet and wait for the appropriate responses. The telnet read VI is given a read line separator and reads from the telnet connection until it matches the read line separator with a text string read back from the telnet connection. If not match is found it times out and creates an error.
    I am not sure how to provide an example of the overall scheme since the problem occurs when both top level VI's are compiled each into their own shared DLLs. Those DLLs are then call from Teststand and at some points they are both running at the same time on the same computer connected to two different UUT's.
    The question I have is why does one DLL share functions with the other? When one DLL is using the telnet read VI the other DLL waits for the first one to finish with it before it can it use the telnet read VI. If they were both compiled separately each into their own DLL shouldn't they each have their own set of functions to call upon instead of having to share? I know that if the two top-level VI's are not compiled they cannot both execute the same sub-VI at the same time. The only way to get around this is to set the execution property on the sub-VI to reentrant.
    I actually fixed the problem by setting the VI I attached and the Telnet Buffered Read.VI (called by Telnet Read.vi) execution properties to reentrant. However, I am still concerned about two separate DLLs sharing sub-VIs. Why does it do this?
    Joshua

  • Getting 'Paint' and 'Sales History' to run at the same time

    Hi,
    Is this a matter of setting up a port for Paint and another for SH? Is there a limit to the number of OBI repositories that can be running at the same time?
    Thanks!

    Thanks.
    Can two or more repositories exist in the same rpd file? Can Paint and SH be in the same rpd file and be used by seperate groups that access completely different data sources?
    In our case, the dimensions and facts for glass used in a car are very different from the dimensions and facts for a car's transmission. There are similarities, true, but they are still very different.
    So, in one rdp file can there be seperate presentation folders for Glass, Tires, Transmissions, Seats, Axil, Engine, Steering Wheels, Head Lights, and etc...
    Each presentation folder would be used by different people. Each presentation folder would access different tables. The Glass Parts business will use the Glass presentation folder, the Axil Parts Guys will only use the Axil Presentation Folder, etc..
    As always, thanks!

  • Two processes running at the same time in Lookout

    I have installed Lookout 5.0 with 200 I/O Points onto our server computer. The application of motion control is next to the 200 I/O points through OPC PMAC server/client. Now I would like to have a second process in the same server for trouble shooting and testing without stopping the motion control process. However, this second testing process could have also many I/O points through Serial and USB ports. I assume that the total amount of I/O points of both processes will be greater than 200.I prefer to have independent processes for control and testing because access levels. Can I have these two processes running at the same time when needed?

    Hi,
    From your description you are using a third party OPC server for the motion application. You could have a second Lookout process communicating with the same OPC server with no problems, as long as you do not exceed the number of I/O points your license supports.
    Also, the process you are using for testing obviously could not overwrite datamembers (or registers if you will) that would interfere in the overall application, in other words you can test your application as long as you keep the coherency of the test.
    So the answer would be, yes it is possible, however you are still limited to the number of I/O's your license supports... You may even consider upgrade the number of I/O's you have in your license.
    Best Regards
    Andre Oliveira

  • Multiple scripts running at the same time?

    Is there a way to have multiple scripts successfully running at the same time?
    At the moment if I start a second script while the first one is still running, the second one completes successfully but the first one stops. This seems to be because the first one is no longer the active document once the second one opens so can't continue.
    Is there another way to script things like this so that multiple can run independently at the same time? You might ask why I'd want to run two at the same time and not just wait, but i've setup an asp.net web form front end and having problems if two people click the button around the same time.
    I'm guessing this isn't going to be possible and i'm going to have to look for ways of doing this in asp.net instead and somehow queue the requests so you have to wait longer if the script is already running?
    Thanks,
    Andy

    I'm
    guessing this isn't going to be possible and i'm going to have to look
    for ways of doing this in asp.net instead and somehow queue the requests
    so you have to wait longer if the script is already running?
    This is correct. The scripting interface to PS is single-threaded so you will need to queue up requests.

  • How to limit the max dialog no that one user can use at the same time?

    Hi,
    I meet one performance problem that one user can open 6 sessions in the GUI and he/she can run 6 reports at the same time witch could occupy 6 dialogs in the sap R/3 instance. It makes poor performance for other users.
    Would you pls tell me how to limit the no. of sessions one user can create at the same time or how to limit the no. of dialogs one user can occupy at the same time?
    Thanks a lot!
    I used this parameters in the default profile as blew:
    rdisp/rfc_check 1
    rdisp/rfc_use_quotas 1
    rdisp/rfc_max_own_used_wp 20 (means: 20%)
    It still didn't work.
    Sean

    Hello,
    We can reserve DIA W.P by giving value to the parameter :- rdisp/rfc_min_wait_dia_wp=1(default)
    that have to necessarily remain free for other users.
    This parameter is used to reserve a number of dialog work processes for Dailog mode.
    For eg. If 10 dialog w.p. are configured for the instance(rdsip/wp_no_dia=10) and the parameter rdisp/rfc_min_wait_dia_wp=3 is set,parallel RFC's can occupy a maximum of 7 DIA W.P.3 DAI W.P. always remain free for dialog mode.
    But now the question is how we assign/restrict this free dialog w.p. to the specific user.
    Reply...
    Regards,
    JUNAID

  • Java threads. Are they running at the same time?

    Hello everybody. I am implementing a multiagent system in java and at some point in the program i need a specific function (from a specific class) to run at the same time in several "copies". Those functions are communicating with each other with some messages, so as you can understand not running at the same time is a big problem because of this messages.
    Below i am giving you an example of the code i am using. I would like your opinion whether those functions are running parallel or serial. If they are not running parallel what should i do? Any opinion or something that can help me would be perfect. Thanks in advance.
    //my class
    public class Agent extends Thread {
                           public void MinConflicts(Agent array[],int max_moves){//code in here}
    public static void main(String[] args) throws IOException {
                  Agent[] fbi = new Agent[num] //num is inserted by the user
                 //code here
                 for(i=0;i<num;i++){
                         fbi.start(); //starting the treads
    for(i=0;i<num;i++){
    fbi[i].MinConflicts(fbi,max_moves); //running the function that i want to run parallel
    //code here also :)

    What you appear to be doing here is creating an array of Thread references (which I hope at some point gets populated with actual Thread object references!)......because your first loop is wanting to cycle through each array slot starting the referenced Thread. Then the next loop iterates through the array again, this time calling the method for each Thread object.
    Assuming that you do populate the array, what this code will do is start each Thread which, I believe, will start and immediately terminate because run() has not been over-ridden. The second loop winds up calling the method for each Thread in the array. You are actually calling it from the main thread though. So, as previously advised, I think that you will run each method sequentially.
    The direction that I would head with this is to override run() in your agent Thread and have that run() method call the MiniConflicts() method. Then, in your main routine you can do away with the second for loop. The looping start will start all of the individual threads and they will execute the run() method......which in essence will be executing your MiniConflicts method.
    This reply is NOT a total design... I am sure that there are holes to be filled... but I think that will get you headed in the right direction.

  • Dreamweaver and Fireworks won't run at the same time

    Recently, I've run into a problem where I cannot run Dreamweaver and Fireworks at the same time.
    I have Dreamweaver CS4 & Fireworks CS4, which I can still run at the same time.
    However when I run Dreamweaver CS5.5 and try to launch Fireworks CS5.1 I get a C++ Runtime error in FW CS5.1.
    And when I run Dreamweaver CS6 and try to launch Fireworks CS6, Fireworks CS6 freezes before fully loading.
    If I run DW CS6 and launch FW CS4, I can get them both to run together, but when I close FW4, DW CS6 crashes.
    Any suggestions would most appreciated.
    David

    Historically, I've always kept prior versions installed because sometimes, albeit infrequently, I need to access extensions that aren't compatible with the newer versions of CS. Since I can run DW & Fireworks CS4 together, I'm inclined to leave them installed.
    I've thought about uninstalling CS 5, but I don't think that would resolved my issue. I've already tried most of what's in the Adobe troubleshooting suggestions save for creating a new administrator account.
    I think I'll hobble along with my current workarounds since I'll be migrating to a new computer very soon, which should acomplish what creating a new administrator account would. I'll probably limit the reinstall to CS 6 to eliminate any issues that might be related to having multiple versions installed, which in reality shouldn't be an issue because again, I've always done that successfully in the past.
    Thanks for the suggestion just the same.

  • Having two background brarchive running at the same time with -f 1 options

    Good morning,
    I need to run two brarchive in parallel as background  process.
    I would like to have on for the save and one for the copy.
    I need that because they would have different files.
    1. Is this configuration supported or not?
    As a file is created for the locking (.lock.bra) I have the feeling that a single process is supported?
    2. Just to double check, can I run two brarchive with two different config file in a serial manner
    (lauch the 1st one, wait for its end, launch the 2nd one, waits for its end).
    3. If you are using that kind script on your systems, could you please provide them?
    4. If brarchive is launched by a script how do you shut it?
    Do you do just a kill of the script or do you kill it and send another signal to the brarchive if it is currently running?
    Thanks in advance for your answers.

    Good afternoon Eric,
    > Why do you want to use option -f 1? what are the reasons being this?
    -f makes it run in background.
    For me, there two advantages for doing that.
    1. You start it once, when you start sap, and it runs regularly
    2. When you stop sap, you stop braarchive.  Then you are sure that no crontab jobs are going to be started when you have stopped SAP.
    > you want to stop  brarchive with option -f running? try:
    >
    > brarchive -f stop
    This is what is currently done right now.
    It works well.
    I can use it because we do a single copy of the archive log up to now.
    We are going to run two brarchives (one to save to a tape robot with backint and one that scp).
    I would like this to run as daemon.
    Now, that you have answered that I can not have two brarchives running at the same time (thanks for your answer),
    I need to write my own daemon in sh or perl that would do:
    1. Run brarchive first run (with -p backint init<SID>.sap file)
    2. Wait for the en of the brarchive process and log
    3. Run brarchive second run (with -p scp/stage init<SID>.sap file)
    4. Wait for the end of the brarchive process and log
    5. Sleep during a few minutes
    6. Handle stop signal so that it ends the forked brarchive that may be running.
    I am sure that people on this forum have already wrote such scripts.
    I may open another thread as it divert a little from my original question.
    Thanks in advance for your help.

  • Is it possible to have 2 threads running at the same time?

    Is it possible to have 2 threads running at the same time at different times eg 1 repeats every 20 miliseconds and the other 40 for example. Also could you have 2 run() methods in one script, in one file? If so how? Help soon would be appreciated. Thanks.

    Is it possible to have 2 threads running at the same
    time at different times eg 1 repeats every 20
    miliseconds and the other 40 for example. Yes.
    http://java.sun.com/docs/books/tutorial/essential/concurrency/index.html

  • I have a mac book pro i7 2.00Ghz and 4Gb RAM. I want to run at the same time Omnisphere,Trilian and BFD 2. Will it work fine? Anybody that has some experience? Thanks

    I have a mac book pro i7 2.00Ghz and 4Gb RAM. I want to run at the same time Omnisphere,Trilian and BFD 2. Will it work fine? Anybody that has some experience? Thanks

    Well this is not a problem I have already bought one, my great worry is the processor and the memory..

Maybe you are looking for

  • Hiding a document library from specific users or groups.

    Just FYI I am far from a SharePoint but have able to accomplish a lot from everyone's help on the forums, so thank you in advace. Now, Is it possible to hide a document library from specific users or groups? Here is what I am trying to accomplish. We

  • Error "The serial number is not valid for this product" | Creative Suite

    HI together, I'm very annoyed about the fact that I payed for Adobe Creative Suite Production Premium 5 (EDU version) and now I'm not able to use it on my new Mac. The Support team (Chat) from Adobe told me several times that the product/serial or wh

  • Select options validation in selection screen

    Hi all, I have select options for plant in selection screen..I want to validate the Plants. and display the invalid plants in the selection screen itself....Since my report is for online purpose i am in need of this requirement...i dont want to print

  • Excise tab not open in MIGO

    Dear Experts, We have create new plant with reference to our existing plant, all testing done except MIGO. At the time MIGO excise tab not open in case of excisesable material, we have already update ch id, Cenvat determination & Vendor excise detail

  • JEditorpane (opening webpage keeps stucked all GUI untill all page loaded)

    hi everyone, i've a riched GUI application, and in that i've used JEditorpane to open webpages in it. i've realized many times, that whenever a website is opened in JEDitorpane all my application gui get stucked, it keeps stucked untill all webpage w