02-28-2008 03:31 PM
Hello,
I am new to labview and am working on a power distribution unit project for
school. Labview receives 8 current, 1 voltage and 8 status values serialy from
a 16f887 microcontroller. The values are displayed on the screen and the status
of eight "outlets" are displayed. The user is able to turn on and off
these "outlets" either through labview or a keypad attached to the
micro. Labview sends the status of the switches and the pic turns on or off the outlets and then sends an updated status value for the switch.
We are trying to stream or data log these values over a period of time
determined by the user. By clicking on a data log button the data should be
streamed to a file for the desired amount of time. This file is time stamped by
date, with the time in seconds. Ideally this should run for 1 – 6 hours, taking
data every 5 to 8 seconds.
The problem I am having is that when the data logging starts, it exits the main
loop and stops sending and receiving serially. I can also not switch the
outlets on and off.
Can labview multi task these two events simultaneously? I have attached my
code, but it does not run without values coming in serially. I was hoping some
of you pros could have a look at it and find the issues.
Thanks for the help!!
Rennie
02-28-2008 03:50 PM
02-28-2008 04:14 PM
02-28-2008 04:17 PM
02-28-2008 05:49 PM
02-29-2008 12:24 AM
03-03-2008 08:53 PM
03-04-2008 12:39 AM
Please attach your actual VI, it is almost impossible to give detailed advice from a picture alone.
You have broken wires because you create loops that violate the requirements for dataflow. You cannot wire to something from inside the loop to ouside the loop and then back to the inside of the loop or your code breaks because of deadlocks. Dataflow dictates that (1) a structure cannot start executing until all inputs have data and (2) A structure only outputs data once it is finished. In your case, the "open/create/replace file" cannot execute because it relies on data from inside the loop, but the loop cannot start because it relies on outputs from "open/create/replace file".
You need to open the file outside the left side of the loop and no inputs to it can come from inside the loop if you do that. If you design your code as a state machine, you can open the file inside a special state (inside the loop) an then place the file reference inside a shift register for further use in other states.
Also NEVER use "use default if unwired" tunnels for file references as you apparently do.
I don't understand what you are trying to do in the second picture. Makes little sense.