LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading two data sets and writing to file

Hi, I am using Labview 7 via a USB-GPIB connection to run a dual gated photon counter (stanford research SR400). I have managed to write a program with help from the discussion forums, which will tell the counter what to do, gets both gates A and B to count in the correct way, and reads both data sets into a graph, and data A into a table. I am hoping my problem is a simple one, I would also like data B to be displayed in a table, and I would then like all the data to be sent to a file on the hard drive at the end of each run. I seem to have real trouble getting steps to be repeated without messing up all of my code, which is why even though the counter counts data B i can't get it to display it numerically in Labview. I have only been using LabView just over a week so i'm hoping this problem is due to my lack of experience! Any advice on getting the data out for B as well as A, and then on how/where I tell it to write to file will be greatly appreciated!
0 Kudos
Message 1 of 3
(2,661 Views)
You say you want to repeat the steps, but I see no loop. All I see is one big sequence frame. Are you using the Run Continuously button in the toolbar? If so, stop. That should only be used in specific debugging instances, and this isn't one of them. You need a loop that you can stop using a front panel "Stop" button.

Also, is there any specific reason why you're using the old GPIB functions instead of VISA?

Also, you have delays in the frames, but because they're free-floating, there's no way to control when the delays occur. Are you intending them to occur at specific times, like after a write? If so, they need to be wired that way to enforce data dependency. You can create a very simple "Wait" VI that has error in/error out so you can do this.
0 Kudos
Message 2 of 3
(2,652 Views)

Hi,

Yes I know the code in bits looks a bit strange, but there are massive issues with this instrument (which in my case was purchased in the 1980's) and getting data over GPIB into labview. There is code posted on the NI website, but it doesn't work, as it fills up the buffers and is not able to re-set them so you just get a "buffer overload" message. Working through all of the posts regarding problems controlling an SR400 in labview, and examples posted I managed to get that working code, which does read realtime values, but only using the older GPIB functions (I don't really know much about any of this, so pretty much did what I was told by other users!). I'm not sure about the waits, I know that without them my data doesn't get written into labview at the right time, I think they are just 10ms waits before labview reads from the SR400, possibly due to how old and slow the counter is?

I have arranged the code into frames side by side so i can try to understand and follow what is what as I've never done any programming before. I understand that I should put a loop in the 6th frame I think? I really keep doing something wrong trying to do this. I can just about handle the wiring things together, but loops get me lost! I am not trying to run in a continuous way, just do say 10-50 periods at a time.

Thanks

0 Kudos
Message 3 of 3
(2,643 Views)