Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

dice vi in labview needed.Can all the experts in labview help?

i need to use labview to create a dice vi.This dice vi needs to test an interfacing hardware downloaded with a dice program(written in vhdl).
i really need help in writing the vi and using the daq card to interface with the hardware.I'm using a pci-6503 with cb-50lp, and labview 6i.
Here are the specifications for the vi:
1.Needs 7 dig_read_to_lines to show the leds(display 7-seg to show the numbers of dice after each 'throw');
2.needs 2 dig_write_to_lines to tell the hardware to when to start and when to reset.When start is first pressed, the 7-seg will display a continuous running random number, and when the start is pressed the 2nd time, the 7-seg will stop to display a random number.T
he reset when pressed will make the 7-segment back to 0.
3.both the read and write can also using read_to_port or Write_to_port(i'm not very sure how).
The problem is to combine both read and write togather so that the vi can continuously read the hardware and display random running numbers and at the same time able to start,stop and reset as desired.I've tried doing it,but unsuccessful,becos either the numbers don't run continuous or the numbers don't start,stop andt reset as desired.
Pls help and if anyone can show me a model dice vi,it'll definitely help alot.Its quite important.
0 Kudos
Message 1 of 4
(4,805 Views)
Here is how you can set up your VI. I would recommend using the read and write to digital port VIs. Use the DIO advanced VIs to get the results that you need. You will see that the read/write to digital port VI basically use two steps - Port Config, and Read/Write Port VI.

Here is my idea. Outside of a loop run Port Config VI and configure one port for read and one port for write. Then in the loop you will read and/or write to digital ports depending on certian conditions such as start, stop, reset, etc (use case statements). You can use the line mask to read or write the lines of interest in Read/Write Port VI.

So when the start button is pressed the program will write out a value to the write port and start the read from digital port.
Then when the the st
op button is pressed, the program will stop reading from the digital port. Finally when the reset is pressed, you can not set the read port to zero, but you can set the indicator on the front panel to zero (maybe use a local variable). The read port will simply return the value at the port and does not set the port to a certain value (it is a read port and not a write port).
0 Kudos
Message 2 of 4
(4,805 Views)
I've done two vi to interface from hardware to labview vis.Can anyone who is good check and verify that the two vis are fessible.Please respond.

grays
Download All
0 Kudos
Message 3 of 4
(4,805 Views)
Hi NP,

I can not be sure what is causing the problems but here are two suggestions.

1) Check all your error clusters. This is first palce to look when you are having problems. The error codes will generally give you a clue as to what is wrong.

2) It looks like you are using virtual channel names. Make sure the line you are using for reading are on a seperate port than the lines used for writing. Only a limited number of boards will allow you to write and read from the same port at the same time.

Other-wise:
NICE CODE! I liked the graphics.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 4
(4,805 Views)