Sending a Trigger pulse from the Jetson nano to the PLC

Hello,

I need to send a trigger pulse (with a pulse width of100mS) from the jetson nano to the PLC, how do I go about doing this?

PS: I’m using the DVP28SV PLC.

Hi contactnikhilrb,

Are you using the devkit or custom board for Jetson Nano?
What’s your Jetpack version in use?

How did you connect Jetson Nano with PLC?
Are you trying to generate PWM output from Jetson Nano?

Hello @KevinFFF ,
I’m using the devkit, Jetpack: 4.6.1
I intend to use the GPIO pins (PWM pins either 32 or 33) on both the Jetson Nano and the PLC.

Yes.

The PLC I’m using:

Does the code snippet below from ChatGPT translate to a trigger pulse with a pulse width of 100mS?

Please refer to the following thread to output PWM from the devkit through sample application from Jetson.GPIO.
Unable to generate PWM with Nvidia Jetson AGX Orin Development Kit - #6 by KevinFFF

1 Like

@KevinFFF On the Jetson nano pins 32 and 33 are PWM, after configuring either of these pins on jetson-io.py, how do I define a pulse width of 100mS & I only need to send a single pulse from the Nano to the PLC.

You can modify the python script for constant period and duty cycle to meet your requirement.

100ms width → 5Hz → Period: 0.2s = 2*10^8 ns

Or refer to the following steps to generate it from PIN33.

$ sudo su
# cd /sys/class/pwm/pwmchip2
# echo 0 > export
# cd pwm0
# echo 200000000 > period
# echo 100000000 > duty_cycle
# echo 1 > enable
(measure the output)

Do you want to send continuous high/low signal(PWM) or you just want to send a pulse signal to your PLC?

Just one single pulse signal is what I need to send to the PLC from the Nano

If you just need one pulse signal, you may just use sysfs or Jetson.GPIO to pull it high/low and add delay between them.

ForJetson.GPIO, you can refer to jetson-gpio/samples/simple_out.py at master · NVIDIA/jetson-gpio · GitHub to control GPIO.

Do I need to use a PWM pin of the Nano to do this? And, do I also need to define the receiving GPIO pin of the PLC?

No, you can just use any available GPIO not used by others for this use case.

I’m not clear about how your PLC works. For your case, it seems you want a output for Jetson (input for PLC).

@KevinFFF Yes, this is what I need.

I still don’t know if the pin details of the PLC (input) need to be mentioned in the code. How do I figure this out?
In the project I’m currently working on, my responsibility is solely to send the pulse signal from the Nano to the PLC. The PLC programming will be handled by engineers at the client’s end.

So, you just need to do the following:

  1. configure the desired pin in pinmux spreadsheet as GPIO/output
  2. use Jetson.GPIO to pull it high → delay 100ms → pull low
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.