Jump to content

1 khz PWM output

Recommended Posts

Hi there,


I am working on a project that will use a V350-35-TRA22 Unitronics PLC. My current problem is to get a 6V 1 kHz PWM signal on one off the HS outputs. The spec sheet indicates an output frequency range of 5-200kHz, but i can't get an output higher than 100 Hz ( cycle time value = 4, duty cycle = 500 ). I have tried to set the cycle time to 0.4 (to get 1 kHz) but it seems that I can't enter a fractional value.


Any help with regards to this problem will be appreciated.


Thanking you in advance,

Trevor Pieterse

B.tech Electrical

University of Johannesburg

Link to comment
Share on other sites

  • MVP 2023

The PWM "frequency' value for an HSO output on the PLC and the PWM function block are different.  I know this is confusing.


Check the Help on configuring an HSO output - Search tab->HSO->Configuring a High-Speed Output.


On a dedicated HSO, the frequency MI is the actual frequency.  For a 1 kHz signal enter 1000 into the MI value.


For a PWM block, the Cycle Time is in units of 2.5 ms.  The best you can do with a PWM block is 400 Hz.


I'm assuming you have a 6V power supply connected through a 2.2K pull-up resistor to the NPN HSO output of the PLC to get your desired signal level.  Don't forget to connect the 6V power supply common to the PLC's power supply common.


Joe T.

Link to comment
Share on other sites

Mr T


I got the HSO all set and running but I've noticed that the output frequency is not constant (+/- 5 Hz deviation). Could this be a result of noise?


I'm struggling to set up a HSC for frequency measurement. The signal being measured is a 2V p-p square wave that won't exceed 3 kHz.

I understand that the voltage must be greater than 3V to be read as a logic '1'. For testing purposes I set up a 5V p-p on the HSC0 (pin 15) with the signal's ground connected to the PLC common but no frequency output is generated in the code.


Any recommendations?  






Your assumption was correct.

Link to comment
Share on other sites

  • MVP 2023

The HSO's frequency stability is not specified.  +/- 5 Hz may be the best it can do.  Did you verify this with an oscilloscope? 


Go back and closely examine the specs on the V350 high speed input - the 3 V you mention for a logical 1 is for the NPN input and the voltage must be below that.  You'll have to get the input above 20.4 V to get the logical 0 or the PLC will never see it.


I would suggest the following level shifter-




Power it with 24V instead of 12V and run the output to the PLC input.  You may have to fiddle with the 1K value to get the transistor to switch with your 2V signal.


Joe T.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...