Activation of channels with a for loop
So basically, I try to select each one of my channels in the order and a complete set of tasks on each. I want to be able to specify which channels are ACTED, so I already have a picture of my selected channels, but when I try to run the loop, it is said that "activeChannels =" needs a picture.
I know that my table of channelNumber is good, but I can't figure out how to make this loop to work.
Here's my loop for:
for (var i = 0; i < channelNumber.length; i ++) {}
doc.activeChannels = channelNumber [i];
do stuff
}
I actually just thought of it. When I declared my channelNumber variable I just declare "channelNumber = new Array (doc.activeChannels)" instead of "= doc.activeChannels channelNumber" and it worked fine. Seems silly not to accept a single channel.
Tags: Photoshop
Similar Questions
-
Capture of sequences of images - issues with nested for loops
Hi all
I've written a vi. to capture a number of images ("Image") and save these images, sent to a folder of my choice. Each image is identified sequentially. However, I would like to make a number of iterations ("run") of this capture sequence, such that each image file name would be "Filename (Run) _(Image_No).png", for example run 5, image 10 'Filename 5_10.png. I tried a nested for loop for this but I have an error message 'Current asynchronous i/o Operation' (I have attached a printscreen).
Can someone help me solve this problem? Please find attached my vi.
Sincere greetings and thanks,
Miika
Hi toto26,.
Thank you for your response. I solved the problem by using a sequence structure flat - file in the first image and all the treatment in the second.
Kind regards
Miika
-
Hi all
I have a simple slider in my pl/sql procedure. I use the method for the slider of the loop and retrieve the values below.
DECLARE
VAR_A VARCHAR2 (100);
CURSOR C1 IS
SELECT DEPT_NAME, DEPT_NO OF THE DEPARTMENT;
BEGIN
FOR I IN C1
LOOP
VAR_A: = I.DEPT_NAME;
END LOOP;
-etc etc.
-etc etc.
EXCEPTION
WHILE OTHERS THEN
DBMS_OUTPUT. Put_line ('hello');
END
This workfine but if the DEPT table does not all records in it, it goes directly to the management of exceptions, and if there are all the other instructions after the FOR LOOP, they will not be executed. I know there is a method to use the cursor (instruction FETCH) more, but I want to know what is wrong by using the FOR LOOP.
The strange thing about this example is, even if I catch the exception, the program stops and if the DEPT table has no recording errors.
Any suggestions or tips are greatly appreciated.the program stops and if the DEPT table has no recording errors.
This seems a little suspicious. Probably another error product which is now hidden simply because of your manager WHEN of OTHER of exceptions, that didn't come out the real error message.
I recommend getting rid of the exception handler together and after the release of the thrown exception.
-
Operation on line on table with a For loop
Hello
I work with a wide range of dimensions column one. I'm doing the following
for i = 1:size (A) / 2
B (i, :) = A (1 + (i-1) * 2:i * 2))
So, for example if
A =.
0
1
2
3
4
5
6
7then
B =
0 1
2 3
4 5
6 7My approach was to use a subset of the table inside the loop for to select several items, but I don't know how to transpose the selected items in a new line to create the table (B) is there a simpler approach?
Thank you
Mike
try experimenting with the table to reshape feeding your table entry and re-sizing for a 2d aray of output. It is much faster to use a loop For, because the data is never moved and LV just changes the dimensions of the matrix and updates the stride.
Ben
-
Accidentally activated always open with .n64 for Adobe
I recently downloaded an emulator and when I was downloading some N64 roms I clicked always open with Adobe when I was trying to put for my emulator. Now my files .n64 save as pdf files and I can't change the file back extensions. I'm at a loss and super frustrated. Any help would be greatly appreciated.
Hello
You can resolve this problem by following the steps below:
Open the folder that contains the file you want to edit.
Right click on the file you want to change and then, depending on the type of file, either click Open with or point to open with, and then click on choose a default program. You will need to locate the N64 emulator and click on it, apply the changes and then click on 'OK '.
Click the program you want to use to open the file.
The opposite is:
- Right click on the file that you want to change, and then select the option "Properties". Look for 'opens with: and click the icon that says "Change...".
- If the N64 emulator is not in recommended programsor other list to other programs , then click on the "Browse" button and locate the correct program by browsing through the folders (or where the program has been installed).
- Click on 'accept' and who is willing to use the files again.
Please let us know if that helps you solve the problem.
Esau!
-
trouble with inner for loop in my procedure values
Hello...
I use oracle 10g and this is my procedure...
create or replace procedure sales_information is
v_qty number (10);
Number of rem_qty (10): = 0;
cursor pck_quantity is
Select * from sales_info;
cursor no_of_labels is
Select ceil (sum (nvl (total_quantity, actual_quantity)) / 400) in the sales_info;
Start
no_of_labels j
loop
because me in pck_quantity
loop
Select nvl (i.total_quantity, i.actual_quantity) in the v_qty of sales_info;
If v_qty > = i.packed_quantity and rem_qty = 0 then
Insert values sales_order-
REM-quantity: = v_qty - i.packed_quantity;
v_qty: = rem_qty;
"exit";
otherwise if v_qty > = i.packed_quantity and rem_qty > = 400 then
Insert values sales_order-
rem_qty: = v_qty-rem_qty;
v_qty: = rem_qty;
"exit";
otherwise if v_qty > = i.packed_quantity and rem_qty > 0 then
rem_qty: = v_qty + rem_qty - i.packed_quantity;
v_qty: = rem_qty;
Insert values sales_order-
Otherwise, if v_qty is null and rem_qty > 0 then
Insert values sales_order-
otherwise if v_qty < i.packed_quantity and rem_qty: = 0 then
rem_qty: = v_qty;
otherwise if v_qty < i.packed_quantity and rem_qty > 0 then
If (v_qty + rem_qty) > 400 then
Insert values sales_order-
rem_qty: = v_qty + rem_qty - i.packed_quantity;
v_qty: = rem_qty;
end if;
end if;
end loop;
end loop;
Inside of the loop will retrieve values of v_qty for each iteration of the loop outside when he runs the only select the following:
Select nvl (i.total_quantity, i.actual_quantity) in the v_qty of sales_info;
and therefore loses the previously calculated values of v_qty and rem_qty
in the previous iteration of the loop outside whereas I want inside the loop iterate on it previously calculated the values of v_qty and rem_qty but can not think of a work around.
-
Problems with nested for loops - save images from a camera
Dear Norbert_B,
Thank you for your response. I solved the problem by using a sequence structure flat - file in the first image and all the treatment in the second! Easy as pi!
Kind regards
Miika
-
Incorrect SCXI all the playback channels after running for more than 30 minutes
I have a SCXI-1001 module. I use a thermocouple module (1102, breakout box 1300), input analog (off 2, map of 1100, 1300 in small groups), analog output (1124 map, 1325 breakout) and a relay (card 1160, breakout 1324). I'm using labview 2009. I created my channels manually to read all channels, I need about 1 task for entries of thermocouple and analog, 1 analog and 1 for task task for the output relay (total 3 tasks). Each task comes into contact with the SCXI area in a different section of a timed sequence. I read all my channels with precision for 30 minutes but then all of a sudden they stop reading accurately and all thermocouples read the same incorrect value as well as all analog input channels. I can't change the output channels either.
The problem occurs more quickly if I increase the clock frequency. There are no errors showing when this problem occurs.
What is an interaction of hardware failure or a software.
Any help would be greatly appreciated. I also need to resolve this issue quickly because it is delaying the test.
Thanks for your help
Tim
Thank you all for your response. I managed to solve the problem. It was a problem with the start of the task and to connect the clocks for different tasks. I've included only a single task to start my unstable code in the source code as for posed multiple startup tasks. However, I started my slave tasks (analog and digital outputs) before starting my master's work (analougue entered). This seems to have solved the problem. I intend to go more far by adding clocks at 2 slave atsks and linking them to the task of master.
I used the sequence as part of documentation. Each links to sequence number to another sheet that I have has a flowchart to say what is each part. As you say there is no need to put in a sequence and do so limit labviews own data stream. I'll remove the sequences and put my documentation on the codes in the code directly because it is made in the examples of labview.
Thank you for your help
Tim
-
Hello
I don't have any experience with parallel for loops, so I need your help.
Goal: To do a calculation (average, average) on the rows (or columns) table 2D as quickly as possible. The calculations are independent of each other and I would get a table 1 d with the results.
I read a few posts on parallel for loops and I would like to find an example for my trivial problem, but I can't.
Could you help me, it is possible is improve it the effectiveness of the calculation on lines with parallelism in LabVIEW? and it is, could you post an example how to do?
Thank you
If the speed issues, do not write your own "average." First of all, it already is in the range of statistics, but then you must be inline your average VI or do the calculation explicitly (as shown below). the size of the array never changes for the duration of the loop, it seems redundant to get the size of the array on each iteration.
Here's what you could do.
On my bench, it's much faster than the use of 'mean.vi' of the palette. Average a overhead, Subvi (1) (2) needs to get N with each call and (3) is also an unnecessary error checking.
(Sorry, I have 32 processors, so the number of instances is set a little high. Modify if needed).
-
CURSOR for loops or an associative array
I just want to know the advantages and disadvantages of the CURSOR for loops. As a general rule, what guys do you prefer: associative array with CURSOR for loops?
If you use the CURSOR for loop, is it not difficult to debug?
PL/SQL Developer, I do not see what values are stored in the CURSOR for loop (in SP master_proc below) as
There are no variables to watch. Not sure if the TOAD can show these values
If I had used an associative array (master_proc2 below), I can see the values stored in the table by clicking on "show Collection"variable in PL/SQL developer.
create table emp2 as select * from emp; create or replace procedure my_proc(p_empno in number) as begin update emp2 set sal=sal+100 where empno=p_empno; end; / --Using CURSOR FOR loop create or replace procedure master_proc as begin for rec in (select empno from emp2 where empno>7700) loop my_proc (rec.empno); end loop; end; / -- Using Associative arrays create or replace procedure master_proc2 as type v_empno_type is table of number index by pls_integer; v_empno v_empno_type; begin select empno bulk collect into v_empno from emp2 where empno>7700; for i in 1..v_empno.count loop my_proc (v_empno(i)); end loop; end; /
VitaminD wrote:
Thank you Tubby. If you are faced with a situation where you MUST use a loop. Then you would go to associative arrays rather than CURSOR FOR loops. Right?Doesn't happen too often, but if/when then I would do as I said in my first post. Use the transformation, the collection table in BULK and FORALLs.
If we use your example posted, I would NOT spend a single table (in a loop mode) value I would be transmitted in the OVERALL picture and treat it with FORALL.
So, I would still use neither of the approaches that you mentioned.
-
How I continuously loop frames with pause for 20 seconds in each image of the scene even without going to the next scene? There are buttons for other scenes in these images. The below works well until I got to the last frame of the scene, then he goes to the next scene and plays. How can I make one loop continuously.
Stop();
var: timer = new Timer (20000,0); / / <--
timer.addEventListener (TimerEvent.TIMER, timerHandler);
Timer.Start ();
function timerHandler(event:TimerEvent):void {}
this.nextFrame ();
or if you want to jump for example 5 executives
this.gotoAndStop(this.currentFrame+5);
}
Thanks for any help.
If you want to stop your timer, use the stop() method:
Timer.Stop ();
PS when you use the adobe forums, please check the useful/correct, if there is.
-
For loops with the cursor line and indexing
Hi all
I have a question about the loops with the cursor, line and indexing.
How can I scan via a cursor with an iterator?
I would use an iterator as
Whole LoopIndex;
Whole LoopIndex2;
for LoopIndex at the beginning of the cursor at the end of the cursor
loop
line =: cursor [LoopIndex];
for LoopIndex2 of LoopIndex at the end of the cursor
etc...
end loop;
I need to use an iterator because I need to use a nested for loop.
OR
How can I solve the following problem?
Class name % ofClass average test Score
1 Niobe 7 8 8.4
1 alena 4 7 7.5
1 9 7 8.9 Estia
1 Lilly 10 8 9.8
1 Sandra 6 8 8.3
1 Melanie 8 8 8.1
Nadia 2 8 3 4.4
Sayuki 2 9 8 8.4
Diasy 2 7 8 8.0
Flower 2 7 8 6.5
Diana 2 6 8 7.3
3 Flora 7 8 5.8
Sukiya 3 4 8 8.4
Samantha 3 10 8 7.7
Roxanne 3 7 8 6.9
Eline 3 8 8 7.4
I need to
-By class, I need to recalculate each average people
-By class, I need to calculate the % of class score (sum averages / people in the class)
So it can be done in a nested for loop?
Or do I just step by step?Well, based on this information it would be something like...
SQL> ed Wrote file afiedt.buf 1 with t as (select 1 as Class, 'Niobe' as Nm, 7 as Score, 8 as Tests, 8.4 as Average from dual union all 2 select 1, 'Alena', 4, 7, 7.5 from dual union all 3 select 1, 'Estia', 9, 7, 8.9 from dual union all 4 select 1, 'Lilly', 10, 8, 9.8 from dual union all 5 select 1, 'Sandra', 6, 8, 8.3 from dual union all 6 select 1, 'Melanie', 8, 8, 8.1 from dual union all 7 select 2, 'Nadia', 3, 8, 4.4 from dual union all 8 select 2, 'Sayuki', 9, 8, 8.4 from dual union all 9 select 2, 'Diasy', 7, 8, 8.0 from dual union all 10 select 2, 'Blossom', 7, 8, 6.5 from dual union all 11 select 2, 'Diana', 6, 8, 7.3 from dual union all 12 select 3, 'Flora', 7, 8, 5.8 from dual union all 13 select 3, 'Sukiya', 4, 8, 8.4 from dual union all 14 select 3, 'Samantha', 10, 8, 7.7 from dual union all 15 select 3, 'Roxanne', 7, 8, 6.9 from dual union all 16 select 3, 'Eline', 8, 8, 7.4 from dual) 17 -- 18 -- END OF TEST DATA 19 -- 20 select class, nm as "NAME", score, tests, average 21 ,round(((average*tests)+score)/(tests+1),1) as avg_person 22 ,round((average / sum(average) over (partition by class))*100,1) as class_average 23 from t 24* order by class, nm SQL> / CLASS NAME SCORE TESTS AVERAGE AVG_PERSON CLASS_AVERAGE ---------- -------- ---------- ---------- ---------- ---------- ------------- 1 Alena 4 7 7.5 7.1 14.7 1 Estia 9 7 8.9 8.9 17.5 1 Lilly 10 8 9.8 9.8 19.2 1 Melanie 8 8 8.1 8.1 15.9 1 Niobe 7 8 8.4 8.2 16.5 1 Sandra 6 8 8.3 8 16.3 2 Blossom 7 8 6.5 6.6 18.8 2 Diana 6 8 7.3 7.2 21.1 2 Diasy 7 8 8 7.9 23.1 2 Nadia 3 8 4.4 4.2 12.7 2 Sayuki 9 8 8.4 8.5 24.3 3 Eline 8 8 7.4 7.5 20.4 3 Flora 7 8 5.8 5.9 16 3 Roxanne 7 8 6.9 6.9 19.1 3 Samantha 10 8 7.7 8 21.3 3 Sukiya 4 8 8.4 7.9 23.2 16 rows selected.
-
Bug in the conditional for loop with an array empty
There seems to be a bug in the loop with a conditional terminal.
If an empty array is connected to an indexed table auto entry tunnel, a tunnel of output array has an element instead of zero.
The constant matrix is left empty.
High loop without the conditional Terminal produces an empty array.
Conditional down with a terminal loop never true generates an array containing a single element
Thanks to LabVIEW version 8.5
-
For loop runs with the value of N unwired
In this case will be a loop run connected to the loop N worthless? I have seen a few examples of the loop for run without a certain number of times set to be ran wired or for example a size of table or something like that.
PauldePaor wrote:
Here's a program I am and as you can see the image that the program runs without the loop N being wired. The program will run without problem
As everyone else has said, you don't have to plug something on N. If you wire up a table for loop for input "auto-index", the loop for will run automatically the smaller table size.
Perhaps an example will help:
This makes a loop on my table size (in this case, long of 5 elements). On the edge of the loop for which resembles [] brackets, indicates that it is auto-indexé. The loop should go through each item one at a time (1, then 2, then 3, then 4, then 5).
-
Why the execution time increases with a while loop, but not with "run continuously?
Hi all
I have a problem of severe weather that I don't know how to fix it because I don't know exactly where it comes from.
I order two RF switches via a data acquisition card (NI USB-6008). One job at the same time can be selected on each switch. Basically, the VI created for this feature (by a colleague) resets all the outputs of acquisition data and active then those desired. It has three entrances, two chain simp0le controls and a cluster table, that contains the list of all the outputs and some practical information to know what is connected (specific to my application).
I use this VI in a complex application, and I have some problems with the execution time, which increased whenever I said the VI, so I did a test VI (TimeTesting.vi) to determine where the problem came. In this special VI I record the execution time in a csv file to analyze then with excel.
After several tries, I found that if I run this criterion VI with the while loop, execution on every cycle time increases, but if I remove the while loop and use the funtionnality "Continuous run", the execution time remains the same. In my high level application, I have while loops and events, and so the runtime increases too.
I someone could explain to me why execution time increases and how can we avoid this? I have attached my VI test and the necessary subVIs, as well as an image of a graph that shows the execution time with a while loop and «run permanently»
Thanks a lot for your help!
Your SetReset_DO VI creates a channel whenever it is called. And that you never delete a task.
When running continuously, that it's as if it only runs once and LabVIEW has internal mechanisms to close references that will not be used again. When a VI is used as a Subvi, LV does not know if she will be called again, and lacks these things until the first level VI stops. You have a memory leak.
Just as you open and close your file outside the loop for, create your channel out of the loop.
Lynn
Maybe you are looking for
-
Internal blu - ray writers no longer works on OS 10.11.6
I have an old MacPro with two writers of blu - ray inside. Everything worked great until I upgraded to OS X 10.11.6. Both drives can no longer read or write on discs; they turn and after a while to eject it. In writing programs is ejected a fresh whi
-
Microphone during regular calls is distorted
MIc is distorted when ordinary phone call.
-
Quicken 2009 crashes on startup after the latest security updates
After you have installed the latest security updates (I think it was 10/01/2010) and tried running Quicken 2009, the program does not start. It hangs at the boot image. I tried to restart and reinstall the program (with available updates), but it s
-
How to install Windows XP via USB?
Hello, can you tell me please how do create an ISO file USB that can install Windows XP on my laptop as there is no CD drive in my laptop? Looking forward to your kind response, Arvis
-
Questions no sound on HP Pavilion g6
I recently changed my hard drive and got a new for my computer hp laptop pavilion g6. Since I installed the OS [windows 7], my laptop had no noise. I have installed many pilots and all do not work. icon said everything when I place the mouse over, it