LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

generate analog current output

Hi Joseph,

You can get the 6528 to generate a pulse train - you'll just have to generate and time this in software. There is no hardware timing on the card. So it just depends what you are trying to acheive, and how you want to run the system.

So you'd need to build up a 2D array of the digital pattern (1 column per channel - number of rows would be number of samples) and then iterate through these using software timing to give you the pulse widths. - software timeing means that potentially the pulse widths won't be consistent.

If you need more concrete and deterministic timing, then you will need to look at a card that you can run the digital lines from a clocking source with.

Regards
Hannah
NIUK & Ireland

Message 11 of 21
(1,580 Views)
Good point, Hannah, and thank you for explicitly saying that. My assumption was that it was intended to be hardware-timed since it was going into a PLC so that's why the 6528 wouldn't work for that kind of pulse generation.
0 Kudos
Message 12 of 21
(1,573 Views)
Hi,
 
I happened to read through a thread  ( Can I use a pci-6528 to generate a pulse train ) and its showed a VI to generate pulse train.I hope i can get my desired infinite pulse tain with this VI.I just wanted to know how do you vary your frequency .If any one has any sample VI which i could use it would be very helpful.I also noticed that they ave not used the DAQ assistant to generate the pulse,is it because the card dosent have hardware timing? ( i noe tatz a strange question)
 
I also had another query,the card mentions the relay type SSR; i believe that if we directly connect it to the PLC it  wouldnt it be a problem,to get digital i/o and pulse inputs to PLC.What if we decide to connect the digital inouts through relays,will it work.And is there a need to power in the terminal block for this card ( assuming we choose the CB-100 block),because we had to power up the advantech cards,and it didnt work for some reason.
 
Thanks for your replies
 
Kind regards
 
Joseph
0 Kudos
Message 13 of 21
(1,560 Views)

Hi,

I tried using the VI that i had mentioned above,but there are wiring errors on the true false basis and the input are not specified.Dose anyone have any clue what the problem could be.

Kind regards

Joseph

0 Kudos
Message 14 of 21
(1,554 Views)
It would help if you provided a link to the thread that has the VI that you're talking about. We're not mind readers...

As for connecting the digital output directly to the PLC this is normally not an issue, but you have to make sure you have compatible voltages and your grounding is correctly wired. In other words, you don't want to have the ground of the card be at a different voltage level than the ground of the PLC. You also need to check what the input impedance of the PLC digital input is so that you can determine how much drive current is required. Typically this is pretty low.

You do not need to provide power to the CB-100. It's just a wiring terminal block. There's no active circuitry on the block.
0 Kudos
Message 15 of 21
(1,549 Views)

Hi,

here is the link for the discussion. http://forums.ni.com/ni/board/message?board.id=250&message.id=14793&requireLogin=False

Regards

Joseph

0 Kudos
Message 16 of 21
(1,544 Views)
The example posted in that thread is how to do a software-based pulse train, which is all that you can do with that card. The frequency is set by the constant of "10" that's wired to the metronome. In this case the period is 20 msec (10 msec for high, 10 msec for low). It's finite since it uses a for-loop that is set to run 100 times, so you get 50 pulses. To make it infinite you would replace the for-loop with a while loop or a timed loop structure. The timed loop structure is available in LabVIEW 8 and above, but I'm not sure if it's available in LabVIEW 7.x. There are examples that ship with LabVIEW that show how to use a timed loop.

Note: As Otis points out this pulse train will not be clean since it's software-based and highly susceptive to anything else that's going on in your system. For low frequencies it may be OK, but a simple file I/O access or Windows doing something will throw off the timing.
0 Kudos
Message 17 of 21
(1,539 Views)
cheerz 4 tat Smiley Happy
 
Joseph
0 Kudos
Message 18 of 21
(1,533 Views)

Hi,

As  suggested by Hanna I tried working on that VI on the other thread: Just have some things to clear about that (please bear with me as this is the first time I am using this software Smiley Sad) there seems to be an error on the true false logic part,from the boolean to the 2D arrary.Also is it possible for me to decide which channels I should give this pulse to.Kindly do let me know what you guys think about the VI ive tried to put up.i have attached the VI ive tried out.Also you mentioned that it software trigerring would be fine for low frequencies( is 1000 hz low or high ?).

I also what to create a 0-24V digital output to the PLC,can i use the DAQ assistant to do it,or should i use the DAQmx to do it.Is there any example code where i can refer to.

Kind regards

Joseph

0 Kudos
Message 19 of 21
(1,513 Views)
Actually, my exact comment was that the software timing may be adequate, not that it would be. As I indicated, a number of factors affect software timing of pulses like this.

To answer your questions:

The error is caused by the fact that the shift register is not initialized, so it defaults to a base type based on wiring. With the invert function in there it's trying to use a boolean. However, it's not going to use a 2D array of booleans, which is what the "Digital 2D Bool NChan 1Samp" function requires. Thus, you need to wire a 2D array of booleans to initialize the shift register. You also need to replace the error in/error out tunnel with a shift register and stop the loop on error. See attached picture (I don't have DAQmx for Labview 7.1 and I can't back-save to that version).

You can specify which channels to use via the "lines" input that you have on your front panel. If you check the documentation in LabVIEW you'll get a whole page on how to specify channels. Here is an excerpt:

For digital I/O, you can specify a range of ports with a colon between two port numbers:
Dev0/port0:1

You also can specify a range of lines:
Dev0/port0/line0:4
Dev0/line0:31

You can specify channel ranges in reverse order:
Dev0/ai4:0
Dev0/ai4:Dev0/ai0
Dev0/port1/line3:0

You can use the DAQ Assistant or just use the DAQmx functions directly. Either way you'll get to the same point. The DAQ Assistant is just a wizard to create a VI for you, but you might not get what you want. For example, I ran the DAQ Assistant on my LabVIEW 8.20 and the VI I got has a loop that sets the each digital out line via an internal for-loop rather than just calling the "Digital 2D Bool NChan 1Samp".

There is some example code for digital I/O generation that ships with LabVIEW. Have you taken a look at the Example Finder (Help->Find Examples). You can also search in the NI Developer Zone for examples.

Message 20 of 21
(1,500 Views)