A loop in the dvSwitches at the exit of the trade
I see some unexpected behavior when I try to separate my script the inscription was of all the port groups on dvSwitches at the data center level. I tried to build a loop around the script that would be subject to an action on each dvSwitch specific vs conglomerating all groups in all ports (initial script works fine, just at the exit is a little messy). What happens now is it seems to be properly running through each dvSwitch and creation of output for each switch, but the result is the same for each switch. So that I have some sort of logical error - need to reset the table at the end of the loop or something like that.
Another bit of household I have addressed successfully before but now does not try to eliminate the members of the specific group - in this case, the output of dvUplinks (I'm only interested in trade). I used a select-string - notmatch in the previous code, but it does not work here (you will see commented out below). I tried a few iterations of the Where-object methods - notcontains researcher here use without success: http://www.powershellcommunity.org/Forums/tabid/54/aft/3993/Default.aspx
$dvSwitch = get-VirtualSwitch-distributed Datacenter - bla
{foreach ($dvs to $dvSwitch)
Get-VirtualPortGroup | »
Select Name, @{N = 'VLANId'; E={$_. Extensiondata.Config.DefaultPortConfig.Vlan.VlanId}}, NumPorts | »
# select-string - notmatch 'dvSwitch-DVUplinks "| "
Export-csv d:\scripts\portgroups\$dvs.csv
}
Any advice is (as always) very much appreciated.
Dave
You must specify which switch you're looking for trade
$dvSwitch = Get-VirtualSwitch -Distributed -Datacenter blah foreach ($dvs in $dvSwitch) { Get-VirtualPortGroup -VirtualSwitch $dvs | Select Name, @{N="VLANId";E={$_.Extensiondata.Config.DefaultPortConfig.Vlan.VlanId}}, NumPorts | export-csv d:\scripts\portgroups\$dvs.csv}
Tags: VMware
Similar Questions
-
Continue the loop after the exception thrown in SQL
How would continue the while loop in the code below after an exception was thrown?
DECLARE v_blob_data BLOB; v_blob_len NUMBER; v_position NUMBER; v_raw_chunk RAW(10000); v_char CHAR(1); c_chunk_len number := 1; v_line VARCHAR2 (32767) := NULL; v_data_array wwv_flow_global.vc_arr2; v_rows number; v_sr_no number := 1; v_first_line_done boolean := false; v_error_cd number :=0; v_quote_pos1 NUMBER; v_quote_pos2 NUMBER; v_enclosed_str VARCHAR(200); v_errmsg VARCHAR2(4000); BEGIN delete from TEMP_MM_UPDATE where username = :P1_USER_ID; -- Read data from wwv_flow_files</span> select blob_content into v_blob_data from wwv_flow_files where name = :P2_FILE_UPLOAD; v_blob_len := dbms_lob.getlength(v_blob_data); v_position := 1; -- Read and convert binary to char</span> WHILE ( v_position <= v_blob_len ) LOOP begin v_raw_chunk := dbms_lob.substr(v_blob_data,c_chunk_len,v_position); v_char := chr(hex_to_decimal(rawtohex(v_raw_chunk))); v_line := v_line || v_char; v_position := v_position + c_chunk_len; -- When a whole line is retrieved </span> IF v_char = CHR(10) THEN LOOP --Make sure there's something to replace IF INSTR(v_line, '"', 1, 1) = 0 THEN EXIT; -- If nothing to replace, exit loop and don't try END IF; --Find the position of the first and second quotes in the line of text v_quote_pos1 := INSTR(v_line, '"', 1, 1); v_quote_pos2 := INSTR(v_line, '"', 1, 2); --Extract the inner string v_enclosed_str := SUBSTR(v_line, v_quote_pos1 + 1, v_quote_pos2 - v_quote_pos1 - 1); --perform the replacement v_line := SUBSTR(v_line, 0, v_quote_pos1 - 1) || REPLACE(v_enclosed_str, ',', '<') || SUBSTR(v_line, v_quote_pos2 + 1); END LOOP; -- Convert comma to : to use wwv_flow_utilities </span> v_line := REPLACE (v_line, ',', ':'); v_line := REPLACE (v_line, '<', ','); v_line := REPLACE (trim(v_line), '-', NULL); --v_line := REPLACE (trim(v_line), '"', NULL); -- Convert each column separated by : into array of data </span> v_data_array := wwv_flow_utilities.string_to_table (v_line); --Check to see if the row of column headers has already been parsed through IF(v_first_line_done != true)THEN v_first_line_done := true; --Check column order in spreadsheet IF(v_data_array(1) LIKE '%Username%' AND v_data_array(2) LIKE '%NDN%' AND v_data_array(3) LIKE '%PCFN%' ) THEN v_error_cd := 0; v_line := NULL; ELSE v_error_cd := 1; END IF; --If first line is done and the column order is correct then ELSIF(v_first_line_done = true AND v_error_cd = 0) THEN -- Insert data into target table </span> EXECUTE IMMEDIATE 'insert into TEMP_MM_UPDATE (USERNAME, RPT_FLAG, PCFN) values (:1,:2,:3)' USING v_data_array(1), v_data_array(2), v_data_array(3); -- Clear out v_line := NULL; v_sr_no := v_sr_no + 1; END IF; END IF; exception WHEN OTHERS then v_errmsg := SQLERRM; insert into temp_mm_update (username,error_desc) values (:P1_USER_ID, v_errmsg); end; END LOOP; DELETE FROM WWV_FLOW_FILES where name = :P2_FILE_UPLOAD; DELETE FROM TEMP_MM_UPDATE WHERE USERNAME IS NULL AND PCFN IS NULL; IF(v_error_cd = 1) THEN INSERT INTO temp_mm_update (USERNAME, ERROR_DESC) VALUES (:P1_USER_ID, 'Error. Please check column order in spreadsheet.'); END IF; EXCEPTION WHEN NO_DATA_FOUND THEN insert into temp_mm_update (username,error_desc) values (:P1_USER_ID, 'No Data Found.'); WHEN OTHERS then v_errmsg := SQLERRM; insert into temp_mm_update (username,error_desc) values (:P1_USER_ID, v_errmsg); END;
When I set the exception inside the loop, as above, the procedure seems never to end, and I end up getting a 'NOWAIT' error when I try to remove the table or something like that.
The code works fine if I remove the 'START' just after the loop and also out of the exception within the loop, but I want to be able to specify what's wrong with each record rather than deal with the correct records and then stop after that it is a record that has, for example, 9 values in a column that accepts only 6.
Can anyone help with this?
Thank you
Steven
Play with my code I found what was wrong.I needed to add in the following line in my code block of exception:v_line := NULL; v_sr_no := v_sr_no + 1;
Final code:DECLARE v_blob_data BLOB; v_blob_len NUMBER; v_position NUMBER; v_raw_chunk RAW(10000); v_char CHAR(1); c_chunk_len number := 1; v_line VARCHAR2 (32767) := NULL; v_data_array wwv_flow_global.vc_arr2; v_rows number; v_sr_no number := 1; v_first_line_done boolean := false; v_error_cd number :=0; v_quote_pos1 NUMBER; v_quote_pos2 NUMBER; v_enclosed_str VARCHAR(200); v_errmsg VARCHAR2(4000); BEGIN delete from TEMP_MM_UPDATE where username = :P1_USER_ID; -- Read data from wwv_flow_files select blob_content into v_blob_data from wwv_flow_files where name = :P2_FILE_UPLOAD; v_blob_len := dbms_lob.getlength(v_blob_data); v_position := 1; -- Read and convert binary to char WHILE ( v_position <= v_blob_len ) LOOP begin v_raw_chunk := dbms_lob.substr(v_blob_data,c_chunk_len,v_position); v_char := chr(hex_to_decimal(rawtohex(v_raw_chunk))); v_line := v_line || v_char; v_position := v_position + c_chunk_len; -- When a whole line is retrieved IF v_char = CHR(10) THEN LOOP --Make sure there's something to replace IF INSTR(v_line, '"', 1, 1) = 0 THEN EXIT; -- If nothing to replace, exit loop and don't try END IF; --Find the position of the first and second quotes in the line of text v_quote_pos1 := INSTR(v_line, '"', 1, 1); v_quote_pos2 := INSTR(v_line, '"', 1, 2); --Extract the inner string v_enclosed_str := SUBSTR(v_line, v_quote_pos1 + 1, v_quote_pos2 - v_quote_pos1 - 1); --perform the replacement v_line := SUBSTR(v_line, 0, v_quote_pos1 - 1) || REPLACE(v_enclosed_str, ',', '<') || SUBSTR(v_line, v_quote_pos2 + 1); END LOOP; -- Convert comma to : to use wwv_flow_utilities v_line := REPLACE (v_line, ',', ':'); v_line := REPLACE (v_line, '<', ','); v_line := REPLACE (trim(v_line), '-', NULL); --v_line := REPLACE (trim(v_line), '"', NULL); -- Convert each column separated by : into array of data v_data_array := wwv_flow_utilities.string_to_table (v_line); --Check to see if the row of column headers has already been parsed through IF(v_first_line_done != true)THEN v_first_line_done := true; --Check column order in spreadsheet IF(v_data_array(1) LIKE '%Username%' AND v_data_array(2) LIKE '%NDN%' AND v_data_array(3) LIKE '%PCFN%') THEN v_error_cd := 0; v_line := NULL; ELSE v_error_cd := 1; END IF; --If first line is done and the column order is correct then ELSIF(v_first_line_done = true AND v_error_cd = 0) THEN -- Insert data into target table EXECUTE IMMEDIATE 'insert into TEMP_MM_UPDATE (USERNAME, RPT_FLAG, PCFN) values (:1,:2,:3)' USING v_data_array(1), v_data_array(2), v_data_array(3); -- Clear out v_line := NULL; v_sr_no := v_sr_no + 1; END IF; END IF; exception WHEN OTHERS then v_errmsg := SQLERRM; insert into temp_mm_update (username,error_desc) values (:P1_USER_ID, v_errmsg); v_line := NULL; v_sr_no := v_sr_no + 1; END; END LOOP; DELETE FROM WWV_FLOW_FILES where name = :P2_FILE_UPLOAD; DELETE FROM TEMP_MM_UPDATE WHERE USERNAME IS NULL AND PCFN IS NULL; IF(v_error_cd = 1) THEN INSERT INTO temp_mm_update (USERNAME, ERROR_DESC) VALUES (:P1_USER_ID, 'Error. Please check column order in spreadsheet.'); END IF; EXCEPTION WHEN NO_DATA_FOUND THEN insert into temp_mm_update (username,error_desc) values (:P1_USER_ID, 'No Data Found.'); WHEN OTHERS then v_errmsg := SQLERRM; insert into temp_mm_update (username,error_desc) values (:P1_USER_ID, v_errmsg); END;
-
last snippet of actionscript code persists, not looped in the first excerpt
I have a FLV embedded in the timeline. Various excerpts from "Go to Url" used at various times, when swf loops, only the last part is retained.
If you assign listeners for the same object at different points along the timeline, then if you don't remove them not you keep all of them, and in your case because they all use a navigateToURL call, the last of them remains the last to run when you loop. If you were to replace calls navigateToURL trace() calls, you would see all the follow-up of an exit at the time where you completed the loop.
So you have to either delete once they are supposed to be in effect (using the RemoveEventListener method "beneath") or you can do something in the sense of what sinious showed where you replace the url that specifies the function navigateToURL. For which showed if you would simply be by changing the value of 'currentSection', but if you ar porabe comfortable with using tables, you can just specify the url string in each section instead.
-
Hello
We have a table with records, saved with the date
We would like to display them like this:
month 1
record 1
Record2
fact sheet 3
month 3
record 4
Sheet 5
We have 2 problems
1. is it possible to loop months? and is it possible to loop through the available in the records months only? so if there is no trace in the 2nd month, the output does not display a blank month
2. it seems that we would have to compare a few dates to achieve, and we always seem to generate dates compating errors in the database with loopdates
Our knowledge of the CF is not sufficiently evolved to find the solutions for this, but can someone help us in the right direction?
Thank you!Without seeing your query and data, it is a bit difficult, but what follows, you should get on the right track
Suppose that the column that contains the date called "myDate".
Then, the query
Note: You need to find the proper functioning of your db (this should work for access and sql server)Select myDate, Month (myDate) as mthDate
FROM MyTable
Order By Month (myDate)Then exit
#mthDate #.
#myDate #.
Ken
-
Try to connect to my Yahoo on Safari brings back me in a continuous loop to the login page. My registration using Firefox works fine.
IM using ios10 on an iPhone 6 s
-
If I share a garageband e-mail project, the other person will see that my saved loops on the side I have prefer?
maamefrommississauga wrote:
If I share a garageband e-mail project, the other person will see that my saved loops on the side I have prefer?
No, this information is stored locally on your computer only
-
I tried to set up a cart with Apple Configurator 2. I'm in iOS 9.2, iPad 2 Air and El Capitan. I tried to put in place following the blue print instructions, but that, as a dismal failure as this resulted in 16 of the 20 iPads being brick. So I was their implementation of a group of 20, first install a profile and installing apps. I tried to install my apps, but which have resulted in a loop and the errors that have no definition massively. So now I install apps in small groups of 3-5 applications. The problem that I am running is sporadic looped / hung when I install some applications. There seems to be no rhyme or reason. When I try to install the application on its own, the problem persists. It hangs at step "installation of placeholder. So far, this has happened with: Garage Band, Photo Collage and Socrative Teacher Edition. To solve the problem, I have to 'remove' the partially installed apps and then renounce install the specific application. Even if I try to install the application on its own, the problem persists. Any suggestions on how to fix this? I'm banging my head against the wall here. I'm on hour 25 + (not counting the nights where I hit a button, go home and come back on a random error).
Thank you!
I'm having the same exact problems, described to a T, I also try to update / prepare several wagons and Config 2 has recently been the total scourge of my work. I love the interface and think I have a solid understanding of how to use the program, but the process never ends. I thought whole point of the program was to be able to add/remove/update / manage iPads massively, but it seems to be able to get everything that fact I can only work with 2-3 iPads, both. Even so, I also have problems with remains of place holders or partially installed or removed applications. Please let me know if there is anything I can do to allow this program to run more smoothly.
-
How to stop the While loop in the Structure of the event with the same button?
Hello
I have a problem. I want to use a single control to activate an event in a structure of the event and the same control to end a while loop in this case.
It is possible to use 2 controls to do this, but I need to be alone.
Thank you
You should NEVER place while loops inside the case of the event, and it is never necessary to do. Think about it: all you have to do is spin the code. You can easily use the outside while loop for everything. Simply place the code of the loop internal (without the inner loop) inside the case of delay and manipulate the time-out period between a pending finished and the infinite (-1), depending on the State of the Boolean value.
A very simple example (LV 8.0)
-
Rate the triggered loop of the timed iterations of TTL
Hi all
I have a camera control VI that awaits the shutter of the camera TTL information and use it as a source of synchronization for a timed loop. In this timed loop, the camera is read and analyzed. Program should respond as soon as possible a new image and that's why I put the timed loop to "Throw missing items" so that it does not seek to catch up (events im trying to detect is quite rare and last several frames).
The problem is this: when I put the camera for a certain numebr of frameworks (e.g. 10,000) sometimes due to discarded frames ever loop iteration number the last number of frame expected and do not remove (it remains to 9.998 for example). I noticed I can stop it by deselecting "maintain phase." However, it is clear to me what happens exactly with these settings in a situation of TTL triggered.
It is true that the loop passes the new data directly but starts the next loop the correct number of iteration (+ 1)? Or something else happening?
IM grateful for any help!
Dear j.win,
If you deselect the option 'Maintain the Original Phase', in fact you never will reject any iteration, whatever the value "Discard missed items." On the contrary, the loop will try to catch up the iterations of the end.
Use of a source of external synchronization (for example your TTL) instead of a source of internal synchronization does not change. You can use the 'period' entrance (dt) of the loop timed to specify when the loop is supposed to go (the unit is the "ticks" in the case of an external synchronization source). A value of '1' means that test loop to iterate over all the graduations of external synchronization source. If for any reason any iteration lasts longer than that, you'll have an iteration "end". Also with a value of '1', it is not possible to change the "phase", then the parameter "Initial Phase to maintain" will be defined only weather or not ignore you the iteration. If 'Maintain initial Phase' is set to false, the loop will run immediately after an end iteration to run always, but a little of the latter. If the 'Maintain initial Phase' is true, the loop will run immediately after an iteraion end if the option 'remove point missed' is false otherwise the loop will jump the iteration.
It's more clear now?
Kind regards
-
How to make a loop stop the other in parallel
I have therefore two loops running in parallel. When the loop at the bottom is made and stops, I want to stop the upper loop as well. However, the loop at the top of the page runs in loops of 2 minutes. I need to run in loops because there is a temperature feedback control, and I need a break to let the temperature change before reading again.
Now, is it possible that I can interrupt the "expectation" his expectation and finish the while loop? I tried to look into the structures of the event, but all tutorials just confused me more.
Also, since we're on the subject, what is the best way to connect the error 'en', 'error' of parallel loops? I said to use the queues, but I am at a loss as well. Thanks in advance
Never mind. Found a solution:
http://forums.NI.com/T5/LabVIEW/stop-a-loop-with-wait-timer/m-p/810781
-
Loop through the sequences selected using set of entry points into LabVIEW OI
Hi all
I have an operator Interface where the operator has the option to select specific measures and loop over the sequence selected according to the needs.
Everything works as expected, but the customer wants to remove the default loop configuration pop-up box.
Must be defined by programming the parameters of the loop (and not by the user). I figured out how to build arguments interactive but don't know how to spend it.
Any ideas / suggestions would be greatly appreciated.
Thanks in advance.
Kind regards
SS
UnspecifiedError wrote:
I am aware of this method and it works well, but the requirement is to run with the model process for example 'Test DUT' entry point
Use SequenceViewMgr.ExecutionEntryPoints to get the corresponding entry point object, and then use EntryPoint.LoopOnSelectedSteps ().
Hope this helps,
-Doug
-
The control law of read/write FPGA on the loop of the root / the UI thread?
Hi all
As the title suggests, the read/write control FPGA, https://zone.ni.com/reference/en-XX/help/371599H-01/lvfpgahost/readwrite_control/, is on the loop of the root / the UI thread?
Watch, https://zone.ni.com/reference/en-XX/help/371361J-01/lvconcepts/multitasking_in_labview/, this would indicate as that, but I would get a good response.
Kind regards
David
While I'm not 100% if it acts on the loop of the root / UI thread - calls to the FPGA (e.g. control of read/write operations FIFO) block permanently. I remember having a weird problem in the past where my FPGA operations have been suspended because I was expecting given FIFO elsewhere.
You should be able to test this easily enough - try to open a file dialog during playback of your FPGA. If playback crashes while the dialog is open, you have a loop of root problem.
-
A loop until the end of the column
Hello!
I have a string type 2D table that I want to loop through. The output of the table is feeding an "analysis of the string" vi and then converted into a timestamp. The problem is that the column of my table 2D is a different size. This means that some columns have a few empty cells towards the end of the column. When the cells are feed to the 'string analysis', and it occurs. I want it first is research in the table and delete all of the empty cells or find a way to the loop to the bottom of the column and stop when empty cells begin. The table is not fixed, then it is impossible to use a constant here. Can someone help me on this one?
Greetings
Kristoffer
Here is my interpretation of the solution of Alexander.
Right-click on the inner circle for loop to add the conditional terminal.
-
Hello
I have three loops that run in the same VI. The first loop gain using fifo control data (we call it a loop of producer) and the other receive data from producer loop and save it to a TDMS file. While the last of them acquire loged the TDMS file data and display it on the graph
My data is backed up to the TDMS file, but this is not shown on the grahe.
I was wondering if the data are not displayed because the Labview does not turn three loops on the same time or cause I made a mistake in the third loop.
Thanks in advance for reply
My best regards
PS: Please find attached the VI
First, use a real queue to pass data from your Director to your consumption. There is no need to put awaits your consumption. The dequeue will limit the rate of the loop.
Then put the graph in your loop of producer. It will save you so much headarches.
-
event handler programmatically for different loop than the event itself
Hello
I'm driving a car of mine using compactDAQ in labview. I have two parallel looping using queues. One is for the tips - READ LOOP playback engine - (running more often), and the other for writing to the engine in bits - LOOP to WRITE.
When I shoot a little some (by CAR), the motor starts to move with a pre-defined pace and to a predefined position. So far so good. Thus, when the engine starts, it replaces two bits:
-sets bit BUSY (indicating the movement)
-Disable INP bit, which indicates that the motor is not in a position
As soon as the engine reaches its final destination the BUSY bit is cleared and the bit of the INP is set.
The question is: How can I sign up for the BUSY bit (INP or both) goes high (or low) in LOOP WRITE, given that the bit is read LOOP read? Is it possible to do using queues? I read something about the events, but I don't know exactly how incorporating them in line-ups. Is this OK same design for the engine management?
I have attached some of my code, where I have a structure of the event, where a condition is the change of the busy flag that is updated in LOOP READ. However the structure of the event will never run.
I would like my RTO case run once and then expects busy go upstairs, and then again for INP to go UP and after that the next case is running (stop or other).
I know that my code is not perfect, but I'm pretty new to labview...
Thanks for any information that can help
User events are just another way to communicate between the 2 loops. Queues are also used to communicate between two loops. If you already have a queue from one loop at the other, you could just keep using that. I have recommended the user events due to the structure of the event you have included in your loop of producer. User events can be triggered at any time you want. You can have the code in your block diagram that uses the Event.vi user generate causes the structure of the event with the other loop turns off. Event structures are usually turns off when a Panel before its value control has changed, but they can also be configured for these user events.
You can really make this communication between your two loops in different ways. If you use a LabVIEW 2012 I strongly recommended to take a look at the producer/consumer model, which is available for you to look at this common architecture and compare it to what you have now. If you have not 2012 try to look at the example in my last post on the producer/consumer with user events. You will find more success using architectures such as these.
Maybe you are looking for
-
Disable the overview of the code in the Inspector?
This small overview / presentation / view miniature on code markup is my way and I can't figure out how to get rid...It's like I'm forgetting something obvious, but... Alas, I'm here, I can't find anything. V42.0 FF on Win7
-
Camileo SX900 photo very noisy
Hello I just buyed a SX900 camcorder. All right, next to the fact of the camera specifications seems very noisy even in daylight on a room lit not so high... I'we used both level ISO Auto or manual (like 800) with or without LED activated. Is it norm
-
What can I do after a paperjam?
After that I work with my scaner a paperjam occur and then the sweep star light flashes but nothing hapend and I don't know what to do...
-
WRT54G V8 cannot connect to the web-based configuration page?
Earlier, I reset my router and was able to use 192.168.1.1 to visit the configuration page based on the web while trying to restore a home network, now that I have a new computer using Windows 7 that can not use the easylink advisor. I was able to ge
-
I want to use a windows vista on a computer that has been upgraded to windows 7 upgraded from my labtop from xp to vista.