LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using the Memory Extention Utility

Hi,

I am using a PCI-7833R along with Labview 8. I successfully created a memory block using the memory extention utility tutorial on the ni website, details follows,

Memory Size - 2KB
Data Width - 32 bits
Memory Organisation - 512x32 bits
Address - 0 - 511
Type - unsigned

After creating this block, I tried to use it to store data in these memory locations, this where I ran into problems. I plan to store 32 binary bits in each memory location and then output them to 32 digital I/O lines on the 7833R in parallel.

1. Can I not write or read from memory while running in emulation mode ?
2.  Assuming I succeed in completing (1), how would I map these 32 bits (from one memory location) to out put on 32 digital I/O lines ,in the same clock cycle if possible.

Thanks.
0 Kudos
Message 1 of 8
(2,916 Views)
Good morning mzshaikh,
 
From what you are describing it sounds like you wouldn't actually need a memory space on the FPGA.  But simply a control on the front panel that had the appropriate values.
You would then use this control to connect to the appropriate outputs. (this can be done in one clock cycle.)
 
Is this what you are looking for?
 
Post back if you need more help
 
AdamB
Applications Engineering Team Leader | National Instruments | UK & Ireland
0 Kudos
Message 2 of 8
(2,892 Views)
mzshaikh,
 
1) You should be able to use emulation with the memory blocks.  The timing will be slower than on if compiled, but you can check the logic and even use the actual IO from the hardware.
 
2) You can use the 'boolean array to number' and the 'number to boolean array' conversion functions. You will get the data out of the memory block as a number and convert it into a boolean array.  You can then index that array and pass each indexed value to an individual digital line in parallel.  Another option would be to use the 'split number' and 'join numbers' functions.  You could get the data out of the memory block as a U32 and split it twice to get 4 U8 numbers.  You can then pass the U8 numbers into a digital port.
 
Regards,
Joseph D.
National Instruments
Message 3 of 8
(2,867 Views)
Thanks for the post Jospeh, the solution does work and I have success created a preconfigured memory block, used it in emulation mode and successfully used the " Number to Boolean" and " Index Array" functions to output data to parallel digital i/o lines.

Thanks a lot.

While typing this, I was thinking, what would be needed to do different, if all the 32bits were to be fed to a single digital i/o, i.e. one bit percycle. I tried to connect the 32-bit boolean array created from the " Number to Boolean" function, straight to a single digital I/O line. It didnt like it. Does using the " Method Node" help me out here or some totally new approach.

Guidance much appreciated.

Thanks

mzshaikh.
0 Kudos
Message 4 of 8
(2,849 Views)
It doesn't like it because essentially your trying to write an array of booleans to one individual line. If you only want to write to one line then you must index the array so that you are specifying which element of the array is written to the single line. 'Index Array' will allow you to do this.
0 Kudos
Message 5 of 8
(2,836 Views)

You can put the IO node in a For Loop.  Wire from the 'number to boolean array' (outside the for loop) threw the left border of the For Loop and into the IO node.  This will auto index the array and write each bit to the IO on each iteration of the Loop.  You can put a Loop Timer function inside the For Loop to control exactly how fast the IO is updated.

Regards,

Joseph D.

National Instruments

0 Kudos
Message 6 of 8
(2,818 Views)
Thanks Joseph. I have implemented your suggestion.

Could you advise on the following issue also. The articles "Accessing Memory Using the Labview FPGA Module" refers to the fact that arbiteration would be involved in case of parrallel access of a memory block by two VIs at the same time. Does this stand true even in the case of parallel access of 2 different memory blocks, ie. the code reads the data from two different memory blocks at the same time and outputs the value on two different DIO lines, the eintre code is in a while loop. Would arbiteration be involved in this also ?

Regards

mzshaikh.
0 Kudos
Message 7 of 8
(2,767 Views)
The article you refer to says "The Memory Extension Utility does not allow you to access the same memory block in parallel without arbitration. Multiple instances of the VI accessing the same memory block causes the VI to become a shared resource."  The keywords here are the same memory block.  You can access different memory blocks at the same time without arbitration.
 
Joseph D.
National Instruments 
Message 8 of 8
(2,746 Views)