You are here

SpiMasterExample.vi

SpiMasterExample.vi demonstrates how to set and get properties values of Spi Master port and call methods for transferring data through SPI Master nterface.

Application Block Diagram is shown below.

spi-master-example.png

All components are connected sequentially and all error inputs and outputs should be connected. First, we call DlnConnect.vi component and connect to proper inputs port and host values. Then we call DlnOpenDevice.vi component, which opens any connected DLN-series device. DlnSpiMasterPort.vi gets Dln.Device reference and port index number as inputs and as output we get Dln.SpiMaster.Port reference. Connect Dln.SpiMaster.Port reference output to Property Node to config properties. To add Pin properties right-click on Port Property Node choose Add Element, then right click again on the new element and choose "Select Property" list. After property is added you can change property to read or write also by right-clicking on property element. Connect Dln.SpiMaster.Port reference output to Invoke Node to excecute available methods. In this example ReadWrite method is called.

After all operations with ADC module are done, close Dln.Device reference and finally call DlnDisconnect.vi to close connection with Dln Server and Dln.Library reference.

Rating: 
No votes yet

User login