Image 3D surface plot managed by IronPython as a batch operation

Hi all

I wrote a bunch of data acquisition based on Measuresurement Studio 2012. In the package data can be displayed interactively in 3D (not intensity image) graphics by CW3DGraph activeX component. Because we are a process and take photos every 5 seconds, so the whole process will take a few thousand images. I've implemented IronPython im my c# (Measurement Studio in c#) application and trying to use IronPython script to manage files in batch mode. However, when I try to create the script class, error message reads as:

"ActiveX control '2afa9f10-0b6a - 11 d 2-a250-00a024d8324d' cannot be instantiated because the current thread is not in a single-threaded apartment.

Here's the class:

public class plr3DImage

{

public plr3DImage()

{

Initialize();

}

[STAThread]

private void Initialize()

{

#error msg to the next line

Graph3D AxCW3DGraphLib.AxCWGraph3D = new AxCW3DGraphLib.AxCWGraph3D ();

graph3D.CreateControl ();

}

}

Please note that I already add a [STAThread] before the method to inform the environment will be single thread apartment.

Can someone tell me how to get around the problem? Thank you in advance.

Dufei

Thank you for your quick response. I came across these web pages. In fact, the answers to the question in the first web page, helped me out, and he went around the problem. This is the skeleton of the code.

using System.Threading;

public class My3DImage

{

Private Thread T;

# some other private variables

public My3DImage()

{

#some execept initiating, composing the CWGraph3D ActiveX component.

}

public void SetParameters (#some other parameters in order to generate the 3D image)

{

#this public method primarily used to transfer settings. There might be some other good ways to pass parameters

}

Private Sub Create3DImage()

{

Graph3D AxCW3DGraphLib.AxCWGraph3D = new AxCW3DGraphLib.AxCWGraph3D ();
graph3D = new AxCW3DGraphLib.AxCWGraph3D ();
graph3D.CreateControl ();
graph3D.BeginInit ();
implement the 3D chart view
graph3D.size = new System.Drawing.Size (iwidth, iHauteur);
graph3D.EndInit ();

...

... # do the work of actual data path

...

graph3D.ControlImage (). Save (FullFileName, ImageFormat);

}

Public Sub Save3DImage()

{

T = new Thread (Create3DImage);

T.SetApartmentState (ApartmentState.STA);

T.Start ();

T.Join ();

}

}

Then in the loop of the handling in the IronPython script file, which we call SetParameters (...) first, and then Save3DImage, it will do the job.

Thank you once again!

Tags: NI Software

Similar Questions

  • 3D surface plot of updates and customization

    Hi all

    I use a lot of 3D surface to display a set of data over time, frequency and amplitude as x, y and z axes. I have a few general comments and questions about the use of this plot, I hope to get answers to

    1. is it possible to remove part of the plot? The framework to display 3D land surface is in the default "modern" style. In 'user defined' view, the color can be set transparent and it is deleted as expected. Next time I start the program, the borders are back to "modern".

    I'll have this flag on a tabbed style system page, and it seems not very nice to have the modern control it. The same effect is seen with color map legend, but affecting this one transparent will make it gray.

    2 How to move or resize the map colour legend?

    3 is excluded from the function "reporter Panel" updated graphic plots 3D? I don't want the Panel before updating while I bring new data in the 3D graphic, but even if I bring updates of front panel updated the graph, it's still visible new data are drawn.

    4 logarithmic axes overrides the settings of the axis.  If I have a no logarithmic scale, I can set the range of 0.4 Hz to 11 Hz. If I change to logarithmic scale, the balance with these parameters is displayed as 0.1 Hz to 100 Hz. It's really annoying because it gives little space to manually select the scale. I don't see the reason why I can not select who will use. Major/minor ticks also have nothing to say when the axis is logarithmic, it seems.

    5. is there a way to get a graphic palette in projection mode? I want the user to be able to switch to the display of plance XY and zoom. The cursor only I get is the 'hand' that usually leaves me not to do anything. The way I've implemented zoom now is to have a XY chart under the 3-d chart that the user can zoom.

    6 non-visible cursors in projection mode. I have a slider that is represented by a y - z plan in the view "user defined". When I go to XY projection this slider left. (maybe it's my bad settings)

    7. How can I get a render of the 3D surface plot window without stopping the VI?

    I hope that these issues have really easy answers, of preference I did something weird which is easy to fix.

    I appreciate all the comments on these issues. I added some screenshots to clearify.

    Dear blueprint,

    Thank you very much for your message on our weforum. Please note that this is not a regular indicator. This is called control X. This means that a lot of Labview code is suspended under sub. Please find the files at the following location;

    C:\Program NIUninstaller Instruments\LabVIEW 2009\vi.lib\Math Plots\3D Math Plots\3D Surface\3D Surface XCtrl

    This explains why certain properties of normal control are not available and you are unable to move the different items. You are able to make adjustments on it, so be sure of the frame surrounding the transparent plot for example. What I would recommend is to make a copy of the previously mentioned location;

    -Copy the files in the user.lib directory, maybe also, it is best to create a copy of a zip file.

    -open project files and replace the objects of the project by those of the new location

    -facade.vi should be visible; You can open it and the transparent plotframe.

    -You can also show the graphic palette

    I hope this will bring you further. Best regards

  • Copy the image in the file manager?

    Is it possible to copy an image in the file manager and stick it in another folder of images without deleting the original image.

    One of my clients wonder, anyone know? I think that's not possible.

    Hey there,

    Not at the moment with the current Manager, no.

  • Black lines on 3D surface plot

    Hello, all!

    In my current application, I have a 3D surface chart on which I draw data of power spectrum in a waterfall display.  I did some structural changes to the program; the data passed to the chart values are the same.  Now all I get are black lines across the plot, and it seems to slow my program as well.  The surface chart worked before, but it displays these symptoms after a system failure.  I deleted the original, thought control, it could have been corrupted somehow, but I still see the problem on the new graph.  Can someone tell me what could happen?

    Thank you!

    P.S. Is this normal, not being able to drag and drop a container to ground through a front 3D ActiveX?

    SLOWPOKE,

    Offer useful suggestions is tricky because I can't find a way to reproduce the behavior you describe. I guess we're free Gremlin here in Austin.

    I guess you want to verify that you are not modified the properties of axes anywhere in your code. There is a VI called Properies Axes, allowing you to programmatically set the property Auto scale for each of the axes in the 3D graph (graphics and sound > properties of 3-d chart). You can play with these settings. In LabVIEW 8.6, in fact, this property is extended to include a programmatic framework of values max and min for each axis. There was a lot of functionality added 3-d chart; If you often use these graphs, you can look into an upgrade.

  • Deletion of images of BC content management

    Hello

    This is probably a simple question, but anyone know how to remove the images of the Colombia-British content management system?

    You can remove a picture as you download it, but I'm unable to select an image and remove it from the image library.

    Thanks, J

    Go to Admin > Site Manager > file Manger > Images.

    Thank you

    Sanjit

  • BlackBerry Smartphones backup images via the Desktop Manager

    When I perform a full backup using the desktop software, it load the backups by looking at my most important files (messages & insertion etc.) but I never see it back up my images that I took with the camera.

    All images are stored on my media card when I use the camera on my blackberry. When you perform a save as above, these images get stored on?

    Many people use SyncToy to synchronize your card (or a folder in) to your PC.

    Sync is backup difference, same.

  • How to transfer images of surface on the mini sd card

    original title: surface mini sd card

    How can you transfer photos from surface, on the mini sd card.

    Also if I use this (together with the mini) card in my olympus - then put the tiny party in the slot of surface photos will transfer?

    How do that if it is possible.

    Thank you

    Hi joan boling.

    Once you have inserted your mini SD card, you should see the removable storage device.

    1. Select the library icon in the desktop screen
    2. Select the computer
    3. Double tap on SD under removable storage card
    4. Go to your photo file and copy the photos you want to save on the map
    5. Return to computer (screen open to step 3)
    6. Paste photos

    Let us know if that helps.

  • Boot Manager is missing so that install operating system pretty.

    Original title: Boot Manager missing.

    I use a Dell Inspiron 700 m family machine with Windows XP Edition as an OEM installation. I wanted to try a commercially available cloud operating system just for fun. I installed it on my assembled desktop PC and everything works great, and then I decided to install it on my laptop, that everything is OK until I restarted Windows to the end of the installation. The Boot Manager does not restart and started directly in the new operating system. I know that the windows installation is still on my laptop because I can see the files in the file browser in the other operating system. I know that this probably isn't the place to ask for another operating system, but they do not yet have answers. For your information, I'll give you the name of the operating system I installed and give you the address of the download page. I am out of Windows XP and the new operating system is unable to console me anyway.

    OS name: JoliOS

    Hi J Johny k.

    If you want to reinstall Windows XP, you can follow this link completely.


    Note:
    if you have important data in the drive, make a backup of the data in any external device, such as CD or DVD, flash drive, hard drive etc.

    How to install or upgrade to Windows XP

    Reference: Install, reinstall, or uninstall Windows

    The installation issue with the operating system of pretty, you contact the nice support for assistance.

    http://www.Jolicloud.com/support

    Hope the helps of information.

    Please post back and we do know.

  • Image vs cloning on the new HARD drive with an operating system already installed.

    First of all, I'm NOT tech savvy.  I apologize in advance.

    After several warnings error that my hard drive was in danger of failing, I was finally able to install a new HARD drive.  Windows has had some difficulty in installing Windows 7 to new HARD drive, but I finally found a solution.  So here's my current situation.

    I have the main drive (old) (C:\) which has Windows 7 and all my data on it (it is a Seagate 1 TB HARD drive that came installed on my Dell Studio XPS 8100).  I installed a new WD Black 1 TB HARD drive and was finally able to get Windows to download on it (it reads now like two distinct? score?) E:\ and F:\) see photo.

    Now, my question is this...

    I want to save all my data from my old HDD and put it on my new HARD drive.  One that I have this, I would like to remove the old Windows 7 HDD and use it as "extra" space

    Make a clone of the old HARD drive to the new since I have already installed the new Windows 7 HARD disk?

    Please advise and please keep in mind that I might say things correctly and I can't understand though if the answers are on my level.  I appreciate any help!

    OK, so here is what I would do to try to avoid problems of compatibility or driver, as far as I can:
    -Turn off your system completely and unplug from the power outlet wall
    -Disconnect the old drive in your system (SATA and power cables)
    -Place the new WD Black on the main port SATA (should be labeled SATA0)
    -Turn on your system and put your OS drive you can do a completely new installation of the operating system.
    S ' ensure that you have updated all the drivers and the operating system after the installation
    -Turn off your system and plug your old drive
    -Turn on the system in the BIOS and make sure the WD Black has the priority starting on the old HDD
    -Boot into the operating system and copy all data from the start of your old disk partition that you want to keep for the WD Black
    -Go to disk management and delete the old boot partitions and the old drive system
    -The old HDD should be your secondary drive now and you can freely move files between the two disks
    N ' have in mind that due to the new copy of the OS, you must reinstall all the games and programs in order to operate because of the new system registry

    This should put you on the safe side and prevent any compatibility issue or driver which is possible during a clone or restore procedure. :)

    Captain_WD.

  • There is no project manager how to remove image

    All, morning

    I managed to add a non-existent image for the project manager. Well, actually RH8 did for me. Now, I need to know how to remove it.

    I use a drop-down hotspot and wanted to use images other than what was available RH8. So, I added the hotspot and chose a random image to appear at the beginning of the text. Then I edited the default.css to (among other things) to change the name of the image file on the line:

    x open-image: url(image-name-goes-here.gif)

    I have badly spelled the name of the image, saved the default.css and went back to work in RH8, creating and previewing of content. When my image, I tracked down the misspelled name image and corrected.

    So now I have an image file that appears in the project with a misspelled name Manager, and this file never existed. There is a red X on the icon of the image and the command delete is not available.

    How can I get rid of this file of project manager?

    TIA,

    Patrick

    Hello

    Paste a picture with the same incorrect name in the directory and delete RoboHelp.

    Take a bow

    Willam

  • How to force a refresh of the plot

    I'm trying to load some data from a text file and it draw 2 different contour (3d surface plots).  Inevitably, the first time that I load the file after that I open the VI, crass conspiracy does not refresh.  However, the plot very well done.  I don't know if it's a matter of timing of the completion of all the data of the file loading, or what.  I tried to re-wiring son error to force the sequence and tried sequential structures.  Nothing seems to work and I can't find a control for me to force him to cool off.  Anyone know what could be going on here?  I have included the 2 required VI and an example of text file.  Can someone help me out here?

    Thank you

    Chris

    Hi Chris,

    I ran your code with the enforcement tool point high (light bulb next to the pause button in the run menu - sorry if I've just insulted your intelligence, but not sure about your experience with LabVIEW). I noticed that the variables local just outside the structure of sequence would first update with values 0.0 then the code could perform the function of file as well as the previous code dialog box this feature. Given that local variables were called first in LabVIEW and updated with zeros as opposed to data acquired from your text file, the result is a track of course empty.

    When you run the code a second time, locals have since been updated with the correct values, which is why you get the plot.

    I have attached a screenshot and a .vi of my suggestions for what you can do to ensure the update of these local variables at the appropriate time and allow the data to chart at the interpolation of course in the first run. I hope that this solves your problem. If this isn't the case, please let me know.

    Also, I will take a lot of heat from other programmers out there if I did not at least mention that using multiple local variables throughout your .vi can be problematic in the sense that it can be difficult to properly manage the data flow and can lead to the frustration of troubleshooting. There are certainly better alternatives, but I thought you'd rather have a quick solution for now and worry not about cleaning up the code later.

    Hope this helps,

    Cory

  • M6 Pavilion: HP Pavilion m6 Factory Image recovery fails

    The hard drive has failed, so I bought a new hybrid 500 GB drive. A directed recovery disks from HP and have tried running the setup of recovery, but the process remains still stuck at 23 percent of "copy of the files needed to restore the hard disk.

    I tried to reinstall about 10 times and it always gets stuck at the same stadium at 23%, and the audible DVD drive slows down or stops playback. After a few hours, it shows the message:

    Copy the file fails

    Of D:\PRELOAD\BASE2. STORMWATER MANAGEMENT

    To C:\RM\Image\BASE2. STORMWATER MANAGEMENT

    Press OK to retry

    I cleaned the discs with a Microfiber cloth for my glasses. Original drive was 750 GB. Connected the thorough check for the hard drive in the BIOS and check the RAM. The two passes. Here is a link to the article that I bought. http://www.Newegg.com/product/product.aspx?item=N82E16822178339

    Any help would be great

    Well, I found a solution. In fact I found it weeks and there has been a lot of work.

    First I asked myself, ' why is it I NEED to have a hard drive that is the same size as before or more? Well, the answer is quite simple: the only choice of HP is given to me is not to get the file .iso Windows but to get an image of Windows 7 that HP has changed with some soft/bloatware, they want to bundle with it.

    Despite what says the support agent, it has no technical reason, why I can't use a smaller hard drive. The comparison of the hard drive for car engines is, frankly, ridiculous. The more appropriate analogy for the hard drive would be the gas tank and the processor is the engine. A car with a 15 gallon gas tank will operate as one with a tank of gas of 20 gallons, in the same way as a computer with a 750 GB HARD drive will work with a 500 GB HARD drive. Of course, in both cases, you won't get as much with the smaller model, but it will certainly run. In other words, unless you provide an imager that will fail if it cannot write all the 1 and 0 hard disk he wants, much as do gas pump just insert their 20-gallon fuel tank. So I said screw this dictation arbitrarily bullcrap to me what type of replacement hardware, I buy in order to use MY laptop.

    Now, once I decided that these hoops with, HP and Microsoft, Setup for me to jump through is silly, I decided to make friends with a Penguin that I knew, but never talked to: Linux. This being my first time using Linux quickly led me to the selection of Ubuntu. He was surprisingly simple and easy to install. Now, most people could not understand how to do a Setup for an operating system disk, but if you know the difference between writing MP3 files on a disc and write a CD that can be used in a normal CD player, it's fine. Then, I used my wife's office to burn an installation disc, put inside and Ubuntu with happiness and flawless, himself installed on my laptop. He was ready to go with the pre-installed drivers and download the new drivers as needed during the installation after entering my password for Wi - Fi.

    Things were going well, but I'm not a computer programmer or work in it and I expect a steep learning curve. Well, boy was I wrong on that assumption. Almost everything I want immediately to use is already installed. Not only that, but it is much much faster he was when he was running Windows. The only part that took a little effort to make it work was to steam, but there are step by step guides that appeared just to look for "Steam Linux Installation." For my daily (read: Netflix, web browsing, even games) it works fine. It's a little tricky with the mouse pad, but I usually use a mouse in any case. Overall, I was very happy with it.

    Summary:

    Because Microsoft won't distribute the .iso files directly and HP insists that give you a picture of your laptop particular there is now a user of Linux more and a less Windows user. Honestly, why they do not just offer to send a picture of a laptop, they sold with a hard drive more small is beyond me (I know, legal shenaningans). So, thank you HP and Microsoft to encourage me to learn something else and get away from buying your products. I appreciate it.

    senorelroboto

  • Plot to a certain number of facades of asynchronously called Subvi

    Hi all

    I'm working on a data acquisition and monitoring program and I have a dream to make some very flexible windows for my windows to plot management. Try to make it simple to quickly open different types of plots and view channels in each window. Do not reinvent the wheel, I'm trying to use windows Windows to do this, call asynchronously screws. The VI will be built as an EXE file and used by people unfamiliar with LabVIEW, so try to make it really flexible and intuitive.

    I have configured my VI as in this example and it got real close: http://zone.ni.com/reference/en-XX/help/371361J-01/lvhowto/acbr_call_clones/

    When I run the VI opens regardless of the number of windows tracing (in the case of my Subvi tracing window), I've specified but the plots don't update. Anyone has any advice on how to get this behavior?

    Hello Cesari, I attach a quick proposal that can improve, I hope this help you.

  • Need to draw a few lines on the waveform plot and arrow

    any suggestion, thank you.

    If you want to draw you can draw pictures by using one of the images of the plot. There are three: front, middle and back. Look around, as many examples exist on how to do this, including a couple that ship with LabVIEW. Help-> find example.

  • XP Media Center Image bad message at startup

    I get a "bad image" message when you try to start windows on my xp with the tag "c:\windows\system32\wininet.211" when I click ok I just get your desktop with icons without any start button, nothing that the background image. Opening Task Manager does not show all the programs that are running.  I tried to start in safe mode.  Same message, same result. I also tried to boot from the installation cd and run the repair that gives me a list of commands and I tried chkdsk.  Ran the whole scan, but it made no difference, still get the same result.  This computer doesn't have internet access.  Any ideas before you completely reinstall the operating system?

    Good then - PAM does not run in Safe Mode, so that the logic the file "mssing" would not automatically be replaced (it's good when the sensible things).

    Sooner or later, I would follow with this:

    No matter what you use for malware protection, follow these steps:

    Download, install, update and do a full scan with these free malware detection programs at:
    Malwarebytes (MMFA): http://malwarebytes.org/
    SUPERAntiSpyware: (SAS): http://www.superantispyware.com/
    They can be uninstalled later if you wish.

Maybe you are looking for

  • Lack of purchased content.

    Hi people I bought albums in itunes, but they are now gone from my library? I don't have an iphone and im using an Android mobile phone and phone to view itunes. I wanted to transfer music from my itunes library (because I paid for them) my Samsung p

  • Problems of the icon

    When I tried to download a portable manual asked me to use Adobe, which I did and then almost all the icons on the PC showed like Adobe. I managed to change this in internet explorer, but it means that everything I try to access ends on e lnk which i

  • Aster Disk:S.M.A.R.T PRI hard status BAD, Backup and Replace

    My dear, please help meWhen I start my computer the msg show on screen Aster Disk:S.M.A.R.T PRI hard status BAD, Backup and Replace Press F2 to RESUME [transferred from viruses and malware to the Windows/Hardware forum space]

  • where can I download missing microsoft csrss.exe

    After you remove a severe virus in my computer windows xp now find the file is missing - csrss.exe - where can I download a real safe replacement for microsoft?

  • I created my computer as an administrator and I don't want that. How I got to where I shouldn't enter an admin password..

    When I fist set up my computer. I put it with an administrator account. I don't want that. When I registered the computer somehow I finished with an administrator account. Can you help me. This isn't a business computor, I use it for home only.