ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

MOKE Labview Program (Magneto Optical Kerr Effect)

Hello all,

 

I'm a summer engineering intern at Drexel University and I was wondering if anybody could help me out with this program I've been running. In this program, a magnet sweeps through a specific field that is input by the user in a cyclical fashion. The problem is that this field never returns to zero (e.g. the hysteresis graph for ferromagnetic materials does not close). The program starts at 10 Oe, but ends somewhere around 5 or 6 upon returning to the original value. Any information on this issue would be greatly appreciated, thanks! (The code is attached to this post).

 

JL

0 Kudos
Message 1 of 4
(3,715 Views)

the password for the block diagram is "nosteven". Thanks!

0 Kudos
Message 2 of 4
(3,702 Views)

Hi JL,

 

It is always helpful if you are able to submit a small amount of code that reproduces the issue you are seeing.  The size of your code makes it very difficult to narrow down what could be causing your issue. In addition to the size, I noticed a few items that could help improve the readability of the code, as well as improving efficiency in run-time and in troubleshooting. I have listed them below and included screenshots to help explain as well. It also seemed to me like you may be trying to implement state machine architecture, so I have included a White Paper below as well.

 

In regards to the original question, it is possible that the value is being maintained in an uninitialized shift register. I would recommend using default values to initialize the shift registers of the While Loop. I hope you find this helpful!

 

1)       Clusters- It may be helpful to pass data from one loop iteration to another through a cluster. When we want data from it, we can use the unbundle functions. See “Before Cluster” and “After Cluster”

2)       Array versus Matrix Functions- Although Arrays and Matrices are similar, they are not exactly the same. See “ArrayVsMatrix”

3)       You can branch wires from a constant- see “Const”

4)       You may want to check your code for unneeded logic- See “Equivalent Logic”

5)       It is possible to expand property nodes- see “ExpandPropNode”

6)       SubVIs-I noticed that there were several areas where there was repeated logic. Making a SubVI would make it easier for maintenance. See “Repeated Logic”

 

State Machine: https://www.ni.com/en/support/documentation/supplemental/16/simple-state-machine-template-documentat...

 

Regards,

 

Jason D

Applications Engineer

National Instruments

0 Kudos
Message 3 of 4
(3,645 Views)

Hi JL

 

I haven't looked at your code but would first ask if you are using air cored coils (ie. just a coil) or an electromagnet with a yoke to apply a field. I wonder if your 5-6 Oe is simply a remanant field at zero current associated with the magnetisation of the pole pieces/yoke. For a standard electromagnet and assuming a big enough field has been applied, this remanant field will be in the direction of the last applied field. Thus, taking the current to zero could still leave you with a small magnetic field which you could get rid of by applying a small field in the opposite direction. A small feedback loop could be made to do this...

 

Cheers, Pete

0 Kudos
Message 4 of 4
(3,630 Views)