How do I set while loop priority in an RT Field Point application?
I have a vi that I want to run in an FP2010 that contains 2 while loops, one must be Time Critical priority and the other Normal or lower priority. I will be using RT FIFO to transfer data between the two loops. The Normal loop will be used for communication with a Host PC.
How can I set the priorities of these 2 loops?
Can I run 2 separate vi's in the FP with each set to a different priority And transfer data between the two with RT FIFO? How?
I am using V6.1 and the customer does not want to spend on upgrading.
Thanks,
Chris
Chris,
You are on the right track using two separate VIs with different priorities and using RT FIFOs to communicate between the two. Please see the following tutorial and the related links, one link of which is an example with a zip file containing the RT FIFO VIs for LabVIEW 6.1.
Doug M
Applications Engineer
National Instruments
For those unfamiliar with NBC's The Office, my icon is NOT a picture of me
Similar Messages
-
How to stop a while loop after certain time using Elapsed time vi
how to stop a while loop after certain time using Elapsed time vi.
Hi Frankie,
Just place the Elapsed Time VI inside the WHILE loop, and wire the 'Time Has Elapsed' output to the conditional terminal in the lower right corner (which should be set to 'stop if true' by default).
In the future, please post your LabVIEW questions to the LabVIEW Forum. You have a much better chance of getting your questions answered sooner, and those answers can then help others who are searching the LabVIEW forums. Thanks!
Justin M
National Instruments -
How to stop a while loop in LabVIEW from a C program
How to stop a while loop in LabVIEW from a C code
hi
I think by creating dll you can stop the while loop from your C program.For that you just create dll (Dynamic Link Library) for the VI which has that while loop.
Anyway can u please explain ur requirement clearly. -
How fast does a while loop executes
hi how fast does a while loop actually checks its condition??
depending on the processor speed??
anyone??Sorry I write that wrong,
heres how it should be:
public class whileLoop{
int time, time2;
time = System.currentTimeMillis();
public timer()
while //watever//{
time2 = System.currentTimeMillis();
time2 = time2 - time;
system.out.println(time);
class use{
whileLoop a = new whileLoop();
public void main(String args[]){
a.timer();
} -
How can I set one loop's frequency as a slave of another loop ?
I have 2 loops in parallel. The first runs at 500Hz. The AIread controls the frequency. How can I set the second one at 100Hz ? It is very easy to set it with local variable, but really not clean. The second loop must not use the CPU while waiting the next 100Hz tick. Is it possible ? I am trying to use occurrence, but the second loop will always (I think) use CPU while waiting next tick !
Is it possible to set one loop in one thread and the other one in another thread ? Then set each thread to a CPU (I use a bi-xeon PC)
Thankscariboo wrote in news:5065000000080000001EBE0000-
[email protected]:
> I have 2 loops in parallel. The first runs at 500Hz. The AIread
> controls the frequency. How can I set the second one at 100Hz ? It is
> very easy to set it with local variable, but really not clean. The
> second loop must not use the CPU while waiting the next 100Hz tick. Is
> it possible ? I am trying to use occurrence, but the second loop will
> always (I think) use CPU while waiting next tick !
> Is it possible to set one loop in one thread and the other one in
> another thread ? Then set each thread to a CPU (I use a bi-xeon PC)
> Thanks
One solution is to place a case inside the loop which run at 500 Hz. Put
your 100Hz code inside the True case. Use the "Quot
ient & Remainder"
funtion and the iteration counter to execute the true case every fift
execution of the 500Hz loop.
This may not work if the 100Hz code use to much time, it will then delay
the 500Hz loop.
I would go for the occurences solution. The wait will use some CPU
resources while waiting but i don't think that should be any problem (when
done correctly).
Rolf -
How to stop a while loop when using tab control
How do you use a tab contol to stop what is happening on one tab when you switch to another tab? In the test example I attached, I have a while loop nested inside a case structure controlled by the tab control. When I tab to page two the elapsed timer starts but when I switch to another tab it does not stop. I can't come up with an easy way to stop or exit the while loop when I change tabs.
Thank you
Danny
Attachments:
tab control.vi 24 KBI played with it a little more and came up with this fix. This fixes it but is not tied to the changing tabs as I was looking for. Is this just too many nested loops and a bad idea?
Danny
Attachments:
tab control fix maybe.vi 26 KB -
How to stop a while loop with long delay
Hi everyone,
I am building a simple program for turning on and off a single Bit. The task is to turn ON the Bit for a period length T1, and OFF the Bit for a period length T2. T1 is normally different from T2, and can be controlled by users.
Since T1 and T2 can be variable, they sometimes can be very long.
If I use a Wait function inside a While loop, it needs long delay to be able to Stop the Main program.
The same situation happens when I use Timed loop.
Can anyone suggest me how to do this task?
Thanks a lot.
Message Edited by tatuan on 04-12-2010 12:56 AMHere's another possibility using OpenG Wait ms:
Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas
LabVIEW, programming like it should be! -
How to stop a while loop of event structure from a main vi
Hello;
sorry for my english
I have to stop a subvi from my main vi, the subvi contains a while loop and an event structure so I need to stop this loop while directly from my main vi I have tried global variable but it did not work
any help please or example !!!
Solved!
Go to Solution.
Attachments:
stop a while loop and event structure from main vi.png 16 KBIYED wrote:
Hello;
sorry for my english
I have to stop a subvi from my main vi, the subvi contains a while loop and an event structure so I need to stop this loop while directly from my main vi I have tried global variable but it did not work
any help please or example !!!
If this is an example of how your code looks, I'd clean it up before the developer who has to work on it next hits you over the head with his LabVIEW Style Book.
Bill
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all. -
How to stop a while loop which contains a timed loop
Hi,
I'm a new hand to labview, and I'm using labviw 7.1, NOT 8.x. I'm trying to do a measurement, in which the flow would look like the attached file (I have stipped all hardware related components to make it easy to read). My questions are:
1. In Loop 3, when the comparison (x>20.85) is true, Loop1, Loop2 and Loop3 are stopped, why it won't quit the while loop (I have wired it to while loop stop)?
2. When it is running, I click on stop button, why it won't stop?
Thanks!
Attachments:
SyncTimedLoop32.vi 228 KBhwm wrote:
2. When it is running, I click on stop button, why it won't stop?
The stop button is read outside of the inner while loops. So the inner while loops will continue to run until their stop conditions are met.
hwm wrote:
1. In Loop 3, when the comparison (x>20.85) is true, Loop1, Loop2 and Loop3 are stopped, why it won't quit the while loop (I have wired it to while loop stop)?
It seemed to me like it would, but sometimes it seemed like I had to set change the numeric value one more time before it would. You have a very odd structure there by placing the event structre inside the while loop with the other loops. I think you may be running into issues where events are getting queued up in the event structure, or race conditions between when the event structure might execute relative to the other loops. It is all very odd and difficult to predict all the ways these structures might interact and relative timing. Usually event structures would belong in their own parallel while loop. I think you need to rethink exactly what you are trying to do here. It probably isn't event necessary to use the stop timed structure functions. A local variable or a notified to pass the "Stop status" from loop 3 to the other loops (or the separate event structure loop to the other 3) would probably be better. -
How to EXIT the while loop in Event response section?
I'm writing a program to grab image using a NI card. The application uses the Event structure. When the GRAB button was pressed, it snaps image continually by putting the SNAP function in a while loop. Is there some way to exit the while loop?(Note :The while loop was put in the GRAB IMAGE event response section.)
edit this event-case AND uncheck "lock front panel until the event case for this event completes".
BTW, your thanks should go to Ankita, <a href='http://forums.ni.com/ni/board/message?board.id=170&message.id=151282'>here</a>
cheers!
Message Edited by Dynamik on 11-13-2005 01:26 AM
Message Edited by Dynamik on 11-13-2005 01:38 AM
When they give imbeciles handicap-parking, I won't have so far to walk!
Attachments:
untitled.GIF 20 KB -
How can i set a long String to a xmltype field in oracle9i use PHP?
i can set xml String to xmltype field with:
$sql_insert_sql = "insert into g_province (p_id,p_regionid,p_provincenameobj,solt)
values (g_province_q.nextval,'".$_GET['region_id']."',sys.XMLTYPE.createXML('".$xml_con."'),0)";
but if $xml_con too long,i can not set this content into xmltype fields.
then , i use :
<?
//(tabel_name:articles)DDL; //just for test;
//create table articles (id number(11),content sys.xmltype);
//----------This is insert test----------------------------------
$conn = @OCILogon("in_user","user_in","bigfish");
$stmt = @OCIParse($conn,"insert into articles (id,content) values(1,xmltype(EMPTY_CLOB())) RETURNING content INTO:CONTENT");
$clob = @OCINewDescriptor($conn,OCI_D_LOB);
OCIBindByName($stmt,':CONTENT',&$clob,"1",OCI_B_CLOB);
OCIExecute($stmt,OCI_DEFAULT);
if ($clob->save("<root><a>JUST TEST</a></root>")){
OCICommit($conn);
echo "Insert succes!";
else{
echo "Insert default!";
//---------------Insert end-----------------------------------------
//---------------Select start---------------------------------------
$sql = "select content from articles order by id desc";
$stmt = @OCIParse($conn,$sql);
@OCIExecute($stmt,OCI_DEFAULT);
@OCIFetchInto($stmt,&$rows,OCI_RETURN_LOBS);
echo "<br>Content is:\"".$rows[0]."\"";
//---------------Select end-----------------------------------------
?>
run it ,display these errors:
Warning: ociexecute(): OCIStmtExecute: ORA-22816: unsupported feature with RETURNING clause in /home/www/bigfish/sgtest/testclob.php on line 12
Warning: save(): OCILobWrite: OCI_INVALID_HANDLE in /home/www/bigfish/sgtest/testclob.php on line 13
Insert default!
Content is:""
Warning: Unknown(): ociclose_session: OCISessionEnd: ORA-00600: internal error code, arguments: [729], [28], [space leak], [], [], [], [], [] in Unknown on line 0
how can i set long content to xmltype fields??geng sun,
Ora-00600 is an internal Oracle error. You will need to open a tar with Oracle. -
How can i set a long String to a xmltype field use PHP?
i can set xml String to xmltype field with:
$sql_insert_sql = "insert into g_province (p_id,p_regionid,p_provincenameobj,solt)
values (g_province_q.nextval,'".$_GET['region_id']."',sys.XMLTYPE.createXML('".$xml_con."'),0)";
but if $xml_con too long,i can not set this content into xmltype fields.
then , i use :
<?
//(tabel_name:articles)DDL; //just for test;
//create table articles (id number(11),content sys.xmltype);
//----------This is insert test----------------------------------
$conn = @OCILogon("in_user","user_in","bigfish");
$stmt = @OCIParse($conn,"insert into articles (id,content) values(1,xmltype(EMPTY_CLOB())) RETURNING content INTO:CONTENT");
$clob = @OCINewDescriptor($conn,OCI_D_LOB);
OCIBindByName($stmt,':CONTENT',&$clob,"1",OCI_B_CLOB);
OCIExecute($stmt,OCI_DEFAULT);
if ($clob->save("<root><a>JUST TEST</a></root>")){
OCICommit($conn);
echo "Insert succes!";
else{
echo "Insert default!";
//---------------Insert end-----------------------------------------
//---------------Select start---------------------------------------
$sql = "select content from articles order by id desc";
$stmt = @OCIParse($conn,$sql);
@OCIExecute($stmt,OCI_DEFAULT);
@OCIFetchInto($stmt,&$rows,OCI_RETURN_LOBS);
echo "<br>Content is:\"".$rows[0]."\"";
//---------------Select end-----------------------------------------
?>
run it ,display these errors:
Warning: ociexecute(): OCIStmtExecute: ORA-22816: unsupported feature with RETURNING clause in /home/www/bigfish/sgtest/testclob.php on line 12
Warning: save(): OCILobWrite: OCI_INVALID_HANDLE in /home/www/bigfish/sgtest/testclob.php on line 13
Insert default!
Content is:""
Warning: Unknown(): ociclose_session: OCISessionEnd: ORA-00600: internal error code, arguments: [729], [28], [space leak], [], [], [], [], [] in Unknown on line 0
how can i set long content to xmltype fields??geng sun,
Ora-00600 is an internal Oracle error. You will need to open a tar with Oracle. -
How do I set a NULL value for the parameter field
Hi
I've another question. I'm going to set single values for parameter fields.
// e.g. set today for StartDate parameter field
fc.setCurrentValue("", "StartDate", new Date());
It should be possible to set a NULL value for date parameter fields.
fc.setCurrentValue("", "StartDate", (Date)null);
But this do not work. How do I set a NULL value correctly?
Thank you in advance.
Best regards,
ThomasFirst question - is it a stored procedure parameter?
You can't set a regular parameter field value to a null value.
There was an issue with old version of the JRC, where it was allowing null to go through, but had unexpected behavior at times.
Sincerely,
Ted Ueda -
Hi
I want to exit from loop if error is encountered.
THanksHi Sonu,
This is not a question related to the SDK. This is more of a coding question you should probably try something like StackOverflow or MSDN forums for that next time.
Regarding your question it depends on the language you are using. If you are using c# you can use the keyword "break;" inside an if that checks for the error. In VB you can use "Exit For" or "Exit While".
Best regards,
Pedro Magueija -
How do you set the system MESSAGE_ID to an XML field value?
Hi experts,
I need to set the value of the system MESSAGE_ID to a field that an external company will send in the XML file. What I could gather thus far is that it should look something like this:
//externalRef and container are passed as parameters:
GlobalContainer globalContainer;
String headerField;
java.util.Map map;
globalContainer = container.getGlobalContainer();
globalContainer.setParameter("MessageId", externalRef);
map = globalContainer.getParameters();
headerField = (String) map.get(StreamTransformationConstants.MESSAGE_ID);
return headerField;
The problem is the setParameter() function - not sure how it is supposed to work. The GETting of the MessageId works though but I need to SET it while mapping the file. Any ideas?use the sample code as provided in the link - http://help.sap.com/saphelp_nw04/helpdata/EN/78/b4ea10263c404599ec6edabf59aa6c/frameset.htm
in your case it will be MESSAGE_ID - http://help.sap.com/saphelp_nw04/helpdata/EN/b3/9a2aeb24dc4ab6b1855c99157529e4/frameset.htm
Maybe you are looking for
-
I think I have a keylogger virus of some sort
Hi I recently bought somthing from ASOS with my credit card and then the next day that credit card was used for things which I did not authorise, luckily american express sorted it out. I think I have some sort of keylogger virus or osmething becasue
-
Odd green squares display problem
Hi. In some applications, such as Keynote, Pages and World Of Warcraft, my Macbook Pro does an odd thing with the display. Sometimes squares appear around the centre of the screen (less than 10px in size) and they're often clumped in a bit of a check
-
Use paging in Sharepoint List items
Hi , I am having one sharepoint 2013 . I have written the code to read sharepoint custom list item using C# and Jquery both ..My List is having 5000+ items into list ,and when I am binding those records into my Gridview It is taking time to bind the
-
HT4597 mobileme to icloud, e-mails did not transfer.
When i transitioned mobileme to icloud, not all of my e-mails transferred. How can I access the emails that did not transition>
-
Garbage Collection in jdk 1.3 on 2K
I have recently run into a problem with garbage collection in JDK 1.3 that is reminicent of jdk 1.1x. On complex pages I am getting GC times of 5+ seconds in the middle of the page (sometime multiple times). I have also noted that if I push the compl