Jump to content

Rotating Detector


Recommended Posts

Hello, I am a physicist trying to build a rotating radiation detector which is mounted on a stepper motor. My board is PCI 6503 and I am using LabVIEW 10. I am using the board to create the digital clock input for my stepper motor (TTL pulses).

I have been trying to control the stepper motor with the Write Dig Chan.vi example. My problem is that when i run the program nothing happens and i have to manually turn on/off the knob that corresponds to the line that the clock of the motor is connected to get 1 step. I cannot figure out how to replace the boolean knobs of the array that is connected to the DAQmx Write function of the example in order to make a Flat sequence or/and a loop etc.. The same thing happens using the DAQ assistant. Running the program won't produce any pulses but turning the switch (of line 7 i.e) on/off while the program is running will give me one step.

SORRY for the lengthy post, any help would be grateful,

cheers

Link to comment

I don't think the example is wrong either, I m probably using it the wrong way, here it is:

That example is to demonstrate manually toggling single lines. I think you are trying to generate pulses. Yes?

Look at the "Cont Write Dig Port-Int Clk.vi" in the examples. Change the "Pattern" to 0 and 128 and then run the vi.

Link to comment

That example is to demonstrate manually toggling single lines. I think you are trying to generate pulses. Yes?

Look at the "Cont Write Dig Port-Int Clk.vi" in the examples. Change the "Pattern" to 0 and 128 and then run the vi.

You are correct, i am trying to generate pulses to rotate my stepper motor as a first step, my final task is a bit more complicated (sadly) . I will give the "Cont Write Dig Port-Int Clk.vi" a try and I will be back with feedback, thanks a lot.

My final target is to:

a) send a pulse to rotate my stepper motor

b)after the rotation is complete i want to send another pulse to an MCA device ( multichannel analyzer) to "tell" it to start counting -the voltage coming out of a PMT tube-

c)after the counting is done, the MCA will send another TTL pulse to inform my program that it has finished and

d)it will also send a varying signal in the order of ~mV which i want to collect and graph in my front panel at LabVIEW.

e) This procedure will repeat in the speed and step of my choice.

The controlling of the MCA device is easily done by an other program called Maestro so adjusting the time that the MCA will count and sending of the TTL signal to LabVIEW is rather easy.

I want to ask whether this is possible by modding the "Cont Write Dig Port-Int Clk.vi" or i will have to use a handshaking vi (?).

AGAIN sorry for the super lengthy post but i believe the better you ask the question, the more likely is to get the answer you seek.

Thank you

Link to comment

You are correct, i am trying to generate pulses to rotate my stepper motor as a first step, my final task is a bit more complicated (sadly) . I will give the "Cont Write Dig Port-Int Clk.vi" a try and I will be back with feedback, thanks a lot.

My final target is to:

a) send a pulse to rotate my stepper motor

b)after the rotation is complete i want to send another pulse to an MCA device ( multichannel analyzer) to "tell" it to start counting -the voltage coming out of a PMT tube-

c)after the counting is done, the MCA will send another TTL pulse to inform my program that it has finished and

d)it will also send a varying signal in the order of ~mV which i want to collect and graph in my front panel at LabVIEW.

e) This procedure will repeat in the speed and step of my choice.

The controlling of the MCA device is easily done by an other program called Maestro so adjusting the time that the MCA will count and sending of the TTL signal to LabVIEW is rather easy.

I want to ask whether this is possible by modding the "Cont Write Dig Port-Int Clk.vi" or i will have to use a handshaking vi (?).

AGAIN sorry for the super lengthy post but i believe the better you ask the question, the more likely is to get the answer you seek.

Thank you

It's always good to give a background on what you are trying to achieve. I means you will get a more focused answer.

So. You just need single pulses (an event generator) rather than a pulse train.

There are quite a few ways you can do this in labview. But I've modified the example to just give one pulse as you are familiar with the vi. It's fairly straight forward. Set the OP high. Wait a bit. Then set it low.

For ryou incoming pulse. Take a look at DAQ events. (There is an example). You can then wire the digital out to the digital in and check to see that you can create and detect the pulses.

Link to comment

It's always good to give a background on what you are trying to achieve. I means you will get a more focused answer.

So. You just need single pulses (an event generator) rather than a pulse train.

There are quite a few ways you can do this in labview. But I've modified the example to just give one pulse as you are familiar with the vi. It's fairly straight forward. Set the OP high. Wait a bit. Then set it low.

For ryou incoming pulse. Take a look at DAQ events. (There is an example). You can then wire the digital out to the digital in and check to see that you can create and detect the pulses.

Thank you so much for your time and effort, you ve been very helpful, I will fiddle around with the code and information provided and return with feedback,

cheers

Link to comment
  • 2 months later...

Thank you so much for your time and effort, you ve been very helpful, I will fiddle around with the code and information provided and return with feedback,

cheers

Hello again, I have been away due to exams but now I am working very intensively on this project again and I need some help (again).

My problem is that the control of my Multichannel Analyser (ORTEC's ASPEC-927) cannot be done through TTL pulses after all and I have to find a way to do it through labview. I have been searching a lot in the internet but all I have come up with is either a publication "LABVIEW-BASED MCA EMULATION SOFTWARE FOR ORTEC MULTICHANNEL BUFFERS" or some reference to ActiveX usage for such a task. All I need is to trigger the counting, stop it and input the data in labview. If someone has knowledge on the matter, I would like to know what is achievable and what is not. I have no knowledge of ActiveX programming whatsoever by the way.

ps.I haven't found anything relative to the communication of labview with Maestro 32 which is the default software provided with the MCA card nor "reading" the .chn output files from labview so I assume it is out of the question.

thank you in advance

Link to comment

Hello again, I have been away due to exams but now I am working very intensively on this project again and I need some help (again).

My problem is that the control of my Multichannel Analyser (ORTEC's ASPEC-927) cannot be done through TTL pulses after all and I have to find a way to do it through labview. I have been searching a lot in the internet but all I have come up with is either a publication "LABVIEW-BASED MCA EMULATION SOFTWARE FOR ORTEC MULTICHANNEL BUFFERS" or some reference to ActiveX usage for such a task. All I need is to trigger the counting, stop it and input the data in labview. If someone has knowledge on the matter, I would like to know what is achievable and what is not. I have no knowledge of ActiveX programming whatsoever by the way.

ps.I haven't found anything relative to the communication of labview with Maestro 32 which is the default software provided with the MCA card nor "reading" the .chn output files from labview so I assume it is out of the question.

thank you in advance

Well. A quick search hasn't revealed any drivers others have written. It' seems to be a USB device so you have 2 options.

1. Write a labview USB driver from their documentation (very hard and time consuming)

2. Use their toolkit to write a high level Labview Instrument driver (I'd go for this).

Either way. Unless someone has already done the work or, the manufacturer has supplied some, you will have to write an interface and option 2 would be the fastest and easiest, but still time consuming.

Their toolkit it seems to encompass two flavours. DLL based and active X. Personally I would go for DLL based but that is only because I hate active X with a vengence. It specifically states Labview 5.1 (..gulp...) and they have examples, so you could start by hacking and modifying those.You won't be able to use LV5.1 VIs if you are using a LV version grater than 6 or 7 (I think) so lets hope they have more recent versions.

The toolkit has two options for programming. For programmers familiar with Dynamic Linked Libraries (DLLs), it provides DLLs

and supplemental Windows applications programming interfaces, which can be called from C, C++, or Visual Basic. For

programmers using ActiveX Controls, all the functionality can be accessed more conveniently through ActiveX methods,

properties, and events. The ActiveX capability makes it easy to program the ORTEC products from LabVIEW (Version 5.1 or

later), Visual C++, and Visual Basic. Simple example programs are supplied with both programming options.

Link to comment
  • 2 weeks later...

thanks for the reply, I really appreciate it, I found a way to communicate with MCA with TTL pulses! Thank God! ( some hardware work was needed but it is working now) 90% of my code is ready! I can send pulses -with the write pulse.vi you provided a few posts ago, thanks again- to the stepper motor and the MCA and I can trigger an action with an incoming TTL pulse,

I only have one last problem: After each acquisition/step I need to plot the data written by Maestro 32 (spectrum analyser) in a.chn file. The type of the file is binary and I am having a really hard time "reading" it. I have the complete structure of the .chn file from the manual (basically is a 32byte header and the data comes after that) but struggling with some readingbinary.vi 's hasn't got me anywhere. I also have 2 pieces of code, in FORTRAN and C which extract the information I want from the .chn files (provided in the manual). Basically the .chn file is a spectrum of counts divided in many energy channels, all I need is the sum of counts of all the channels. You have done too much already for me, but I would be thankful if you helped me once again.

Greetings

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.