09-18-2024 07:23 AM
Hello Everyone. I am trying to control relays with LabVIEW but I don't know where to start. I have a pcb with MAX4820 Cascadable Relay Drivers with Serial/Parallel Interface and multiple relays DK2A-5V. The idea that I can connect multiple motors and with the relays I can select which one to drive. I have also USB-8451 box which In pan to use. Please help me how to start and connect it to LabVIEW so I can control it. Thank you
09-18-2024 07:42 AM
Connect the 4820 in cascade configuration to the SPI lines of 8451
In your code, configure SPI to be N x 8 bits long (where N is number of chips cascaded together).
Example, if you have 2 chips cascaded, you need to configure 8451 to send 16-bit long packet where the LSB of the 16-bit corresponds to OUT1 of the last chip in the chain and MSB of 16-bit data corresponds to OUT8 of the first chip in the chain connected to 8451.
Now, in you code, taking the SPI example, form this 16-bit data as needed to set/reset the relays and write to 8451 and all chips in the chain are updated at the end of the SPI write.
09-19-2024 04:46 AM
Hello again. I connected my NI-8452 to my board with MAX4820 in the following way :
left pinf from max4820, right 8452 box
MOSI-SPI_MOSI
DGND-GND
5v - eternal 5 v power supply
CS0-CS(0)
A3,A2,A1,A0 - DIO(2),DIO(3), DIO(4), DIO(5)
SET-DIO(0)
RST-DIO(1)
SCLK-SPI_SCLK
I try to run this example that I fond in the community but I only able to turn on off all relays and I have no idea how to fix it so I can control each individual relay.
Port number is set to 0, when I change it to a different number i have an error indication that port number is not correct. When it is 1, I can turn on relay, I hear a click and leds are on, when I change it to 0 I can turn them off, eds are off. How I can change this code so I can control each individual relay ? Thank you so much