Devantech dS1242 Скачать руководство пользователя страница 59

 

dS1242  

dS1242  

 

  

                                                   User Manual v4.10

Analogue inputs

Two independent analogue input channels of 10-bit resolution are provided for sampling volt-
ages up to 3.3V. Each channel is also filtered with a 10k resistor and a 100n capacitor to sta-

bilise high frequency jitter, there is also a pull down resistor so the port will read around 0 
when nothing is connected. 5V inputs can be used, although the 3.3V to 5V region will merely 

read full scale.

Examples

Example input - connecting a poten-

tiometer

Connecting a  potentiometer should be the 
simplest of tasks, either end of the pot should

be wired to the 5v and 0v respectively, the 
output pin of the pot is then wired into the 

analogue (A) pin. Please note the reading 
from the conversion will reach maximum at 

3.3V.

Representative Analogue Schematic

Copyright 

© 2016-2021,

 Devantech Ltd.

All rights reserved.

www.robot-electronics.co.uk

59

Содержание dS1242

Страница 1: ...dS1242 dS1242 User Manual v4 10 dS1242 dS1242 User Manual Version 4 10 Copyright 2016 2021 Devantech Ltd All rights reserved www robot electronics co uk 1 ...

Страница 2: ...ifications 23 Peer to Peer 24 Sequencer 25 Sequencer commands 26 K Outputs 27 Sequencer Examples 27 Schedules 32 Counter Timers 34 The application page 37 Application page security 38 Accessing your webpage from the internet 39 Boolean equations 40 TCP IP command sets 42 ASCII command set 42 Binary command set 44 AES binary command set 47 Modbus commands 49 Function 01 0x01 Read Coils 49 Function ...

Страница 3: ... 55 Power relays 56 Digital IO 57 Connection Examples 58 Analogue inputs 59 Temperatue sensor 60 Power supply input voltage 60 Analogue channels 60 Serial Port Connections 61 dS1242 dimensions 62 Notes 63 Copyright 2016 2021 Devantech Ltd All rights reserved www robot electronics co uk 3 ...

Страница 4: ...ual V4 07 Added new features Ping Used to ping other machines to check if responding Sequencer Added a 120 step 12 output sequencer v4 08 Added display of MAC address to network configuration page Bugfix NTP Real time clock startup failed under some circumstances Renamed command counters to setcounters V4 09 Added 3 new commands to Binary and AES Binary command set to control all relays in one com...

Страница 5: ...e 82mm x 84mm Controlled graphically by secure webpage or optionally one of ASCII Binary or Modbus com mand sets over TCP IP Email notifications 8 selectable notifications up to 100 emails hour max Peer to Peer Control relays on other modules Schedules Able to schedule events based on time of day week Counter Timers Count or time events 20 counts second Max Also available when optionally programmi...

Страница 6: ...l methods Primary control method is graphically by using its built in secure website Secondary control may be one of ASCII type in commands via a program such as PuTTY Binary Command set using binary codes Modbus Functions 1 4 5 and 15 supported And if you should wish to modify the supplied firmware you can Behind the scenes there is dScript a powerful multi threaded operating system and program m...

Страница 7: ...oaded on the module If the blue led does not flash you will need to load in the control firmware Don t worry this is very easy to do Just go to the chapter on installing the firmware and follow the instructions there If you are using a Win10 PC open your browser and into the address bar not the search bar type http dS1242 index htm You should now see the application webpage and you can control rel...

Страница 8: ...y power If you plug the Ethernet cable in after the power the module will already have booted with a default IP address Alternatively you can find the IP address of the module by checking your DHCP server If you have a DHCP server on your network your router is normally the DHCP server then the dS1242 will get its IP address from that Log on to your router and navigate to the LAN client list Above...

Страница 9: ...our modules that are connected to your LAN DevantechModuleFinder jar If you do not have a DHCP server the dS1242 will use a default IP address of 192 168 0 123 so make sure your PC is on the same subnet of 255 255 255 0 and its IP address is 192 168 0 xxx Copyright 2016 2021 Devantech Ltd All rights reserved www robot electronics co uk 9 ...

Страница 10: ...rs to change So with the USB ca ble disconnected the _config pages are not available If you try to access them you just get served a not authorised page instead So for now you do want to look over the config pages If you have a Win10 Linux or MAC PC you can go right ahead and plug in the USB cable These machines will install their own USB drivers We won t be sending anything to the board its just ...

Страница 11: ...nd its internal temperature If you hover your mouse cursor over the menu buttons on the left the help panel will give you an overview of each one The system reboot button should be used with caution If the module is at a remote site and you change the IP address you may not be able to reach it again Copyright 2016 2021 Devantech Ltd All rights reserved www robot electronics co uk 11 ...

Страница 12: ... will go off again 5 seconds after you stop changing anything Choose an IP address for the module something outside of the DHCP settings on your router so it will not assign anything to that address The subnet mask Gateway and DNS can all be left as the defaults Network changes only take effect after the next re boot so wait until the Update Pending light goes out and give the reset button on the ...

Страница 13: ... long and you don t have to memorise it so make it a long one with plenty of upper case lowercase numbers and symbols Accessing a special webpage _pw htm will install the password on your browser To do this make sure the Enable _pw htm box is checked When the Update Pending light goes out re boot the module and go to yourIP _pw htm You will see something like this The password is now loaded on you...

Страница 14: ... this if required If you do so then you will need to include the port number in the address If you change the port to 2345 then the webpage will be at YourIP 2345 index htm For example 192 168 0 123 2345 index htm Copyright 2016 2021 Devantech Ltd All rights reserved www robot electronics co uk 14 ...

Страница 15: ...ent commands by sending binary commands to the module AES Binary adds encryption Note the AES key MUST be 32 bytes long We have test applications written in C and Java to demonstrate AES encryption The Modbus command set implements functions 1 4 and 5 When selecting the Modbus command set make sure you se lect port 502 which is the official port number for Modbus over TCP IP Phone App confiqures t...

Страница 16: ...irtual relays they have no physi cal presence but otherwise behave the same as the real ones I O lines may be linked to vir tual relays to provide additional physical outputs see next section for details Names may be up to 20 characters long but keep them shorter if you want to use a phone as the controller Here we have renamed relay 1 as YardLights and those 10 characters are a comfortable size o...

Страница 17: ...ollow box If you place a number in this box then that is the pulse time for the relay in mS 1000mS 1 second The minimum value is 100mS The maximum is 2147483647 more than 24 days When the relay is toggled on timing begins and at the end of the time period the relay goes off again If the button is pressed again during timing then the timing is restarted The above example will turn off the yard ligh...

Страница 18: ...it Now change it to R1 The exclamation mark is read as Not R1 Now relay 1 will always be the opposite of relay 2 Try it Boolean equations may be used for controlling relays and other objects such as email See the Boolean equation section later in this manual for full documentation Copyright 2016 2021 Devantech Ltd All rights reserved www robot electronics co uk 18 ...

Страница 19: ...ate of the equation In the previous example where we placed R2 in relay 1 s Follow control relay one will always be the same as relay 2 If relay 2 is off and we click relay 1 YardLights nothing will happen However if we want relay1 to be controlled by relay 2 as above but also want to be able to toggle it on off from the webpage we can put R2 in the Set Relay box and R2 in the Reset Relay box Try ...

Страница 20: ...ile device or whatever you are using to control the module Connecting I O to Virtual Relays Any of the four digital I O lines may be connected to a virtual relay This gives the digital out put the same automation capabilities as the relays Enter the relay number in the link box as shown above Any relay may be selected for an I O Copyright 2016 2021 Devantech Ltd All rights reserved www robot elect...

Страница 21: ... wait for the Update Pending light to go out 5 seconds after last change and reboot the module Repeat Time This is how often the ping is repeated in seconds 10 sends a ping every 10 seconds Attempts The number of failed pings no response before failure is reported by setting the ping time to zero If set to 5 it will take 5 consecutive failed responses to trigger a failure If a response is received...

Страница 22: ...machine A relay can be used to reboot the target machine This may be by connecting to its reset input or even removing and restoring power The details of this are left to you In this example we are going to generate a reset pulse by pulsing Relay1 for 2 seconds when the ping time goes to zero To do this enter 2000 in the pulse follow box and P1 1 in the Set Relay box If you are going to reboot by ...

Страница 23: ... mon to all eight emails The trigger event uses the same boolean equation solver as the relay automation So if you want to trigger an email when digital input 1 I O1 becomes active just enter D1 The email message is automatically filled in with useful information on the state of the relays I O s etc Boolean equations are used for controlling relays as well as triggering email notifications See the...

Страница 24: ...n equation See the Boolean equation section later in this manual for full documentation Target IP Port Relay No should be set to locate the target relay Target action determines how the relay will be controlled 0 No action this Peer to Peer event is disabled 1 Follow Me the relay will follow the input or the Boolean result of any equation here 2 Set Relay the relay will be set by this event You wi...

Страница 25: ... line 01 it delays 1 second and turns on the K1 output Line 02 delays 1 second and turns off the K1 output Line 03 jumps back to line 1 and the cycle repeats forever The K1 K12 outputs may be used in boolean equations to control relays send emails etc Placing K1 in a relays Pulse Follow box will make the relay follow the K1 output in this case pulsing the relay on and off every two seconds Copyrig...

Страница 26: ...er moves on to the next line None of the following commands will update the K outputs If you specify anything in these check boxes they will be ignored The instructions are executed immediately with no delays J1 Jumps to the specified line C9 Calls the specified line The sequencer has a 4 deep call return stack The line following this one is pushed onto the stack and control transferred to the spe...

Страница 27: ...u need to monitor two inputs and perform one of two control sequences depend ing on the input We will need a loop to check the inputs and transfer to the appropriate se quence when active If D1 becomes active control transfers to line 10 If D2 becomes active control transfers to line 20 Otherwise they arrive at line 3 and jump back to line 1 The sequence will loop around these three lines until on...

Страница 28: ...or 60 seconds We then stop the traffic with Amber for 3 seconds followed by Red Again we hold both lights at Red for 30 sec onds before letting the other queue through at line 6 To watch it happen set relays 21 25 29 to K1 K2 K3 and set relays 24 28 32 to K4 k5 K6 Then look at the application page Copyright 2016 2021 Devantech Ltd All rights reserved www robot electronics co uk 28 ...

Страница 29: ...al input for the request to cross button Before changing our sequence code we need to provide a latching request signal because pedestrians expect to give the request but ton a brief push not hold it down Lets use relay 22 for the latched request D1 will set the re lay and K7 will clear it Enter D1 in relay 22 Set Relay box and as the relay will be reset by the sequencer enter K7 in the Reset Rela...

Страница 30: ... keep the pedestrian routine on one page for easier reading Also remove all ticks from K1 K12 on these lines The Call instruction will ignore them anyway but it s good to keep things clear Enter the following on page 2 Line 13 is the 30 second delay where we hold all lights at Red These are the two delays from Copyright 2016 2021 Devantech Ltd All rights reserved www robot electronics co uk 30 ...

Страница 31: ...ontinues with line 15 which just return to the caller on page 1 Line 16 turns the pedestrian signal to Green for 15 seconds and also clears the request signal Line 17 returns the pedestrian signal to Red and waits a further 5 seconds for pedestrians to complete the crossing Line 18 returns to the main sequence on page 1 Give it a try Copyright 2016 2021 Devantech Ltd All rights reserved www robot ...

Страница 32: ...to control the relay When high lighted in red the weekday is active There are two sets of Start and Stop times for each of the eight schedules The relay is set when the start time transitions from inactive to active ie at the start time and reset when the stop time is reached It is not held on or off It can be changed by other events including the webpage buttons The current time originates from a...

Страница 33: ...ay be checked if required It advances the time by 1 hour between the last Sunday in March and the last Sunday in October As well as controlling a relay directly schedules may also be used in the boolean equation fields of other controls A relay could be controlled by placing S1 for schedule 1 in its auto mation field Copyright 2016 2021 Devantech Ltd All rights reserved www robot electronics co uk...

Страница 34: ...ach counter timer is capable of being a timer by entering T1 into its count input box T1 is an internal 1Hz timer that will advance the count once per second If and input is specified then any pulses on that input will be counted D4 will count pulses on input 4 Capture Input This is the event that will cause the current counter value to be stored in the capture register The capture register is dis...

Страница 35: ...We need to know the number of pules per hour coming in First we need a 1 hour time base we ll use counter timer 1 for this Using T1 for the count input will make the counter increment once per second There are 3600 seconds in 1 hour so we reset the counter when its greater than 3599 with C1 3599 The counter will count from 0 3599 Next we will use counter 2 to do the counting of input 2 pulses The ...

Страница 36: ...eal time derived from a schedule The target relay is set to zero as we don t need to use any relays for this All week days are set so we perform the synchronization every day Start stop time 1 is used to activate the sched ule at 1 second past midnight each day The second start stop time is disabled as both times are identical Go back to counter1 and add S1 to the reset input Now our time base tim...

Страница 37: ...guration changes The I O indicators show grey when the I O is inactive Red indicates an active input output The I O s are clickable just like the relay buttons to turn them on and off The screen shows the four ping times in uS the first four of the eight available counters and their capture registers Copyright 2016 2021 Devantech Ltd All rights reserved www robot electronics co uk 37 ...

Страница 38: ...have permission to view this page The _pw htm page which contains the javascript that loads the password into your browser will only be served when the enable _pw htm checkbox is checked on the Webpage Security tab If the password field is left blank the application page will always be served to anyone Entering a password means the application page will only be served to a browser that has the mat...

Страница 39: ...use port 80 for the webpage How ever its a good idea to use a different port number for our boards as this will avoid conflict with any web server you may have on your network Pick a number I ll choose 19321 as our port number Just make sure its different from any TCP IP port number you are using The HTML port is set on the Webpage Security tab After you have re loaded the program you can access t...

Страница 40: ...the relay will follow the input Analog inputs Ping times and Counter values are compared with a number to obtain a true false boolean result In this example we will use analogue input 1 Then we can enter A1 1000 in the relay2 automation box This will turn on relay 2 when the input A1 falls below 1000 If A1 is connected to a temperature sensor and R2 controls a heater well you get the idea Analog c...

Страница 41: ... some hysteresis To do that we will use R2 in its own equation A1 1000 R2 A1 1234 R2 Assume R2 in inactive off The 2nd half of the equation A1 1234 R2 will have no effect So when A1 falls below 1000 the relay comes on Now the 2nd half of the equation is true and will stay true until A1 climbs above 1234 So the relay becomes active when A1 is below 1000 and inactive above 1234 We have hysteresis Co...

Страница 42: ... set allows you to type commands using a TCP IP terminal program such as PuTTY Use PuTTy in raw mode Make sure you have you module set to ASCII mode and after the update Pending indicator has gone out re booted the module so the changes take effect ASCII commands are all two character commands and are not case sensitive Type ST followed by the return key This is the STatus command You will see Cop...

Страница 43: ...t 1 on SO 1 off Set Output 1 off GR Relay number GR 1 Get relay 1 status responds with Active or Inactive GI Input number GI 1 Get Input 1 status responds with Active or Inactive GA Analog Input number GA 1 Get Analog input 1 responds with the 10 bit analog value GC Counter number GC 1 Get Counter1 responds with count capture values Typical PuTTY session Copyright 2016 2021 Devantech Ltd All right...

Страница 44: ...t Relay 7 byte command returning 1 byte This command turns a relay on or off or pulses it for a time period and returns an ACK NACK byte ACK 0 NACK non zero actually the unknown relay number 0x31 The actual command the rest are parameters 0x02 Relay number Valid numbers are 1 2 0x01 0x02 0x01 Turn relay on 0x00 for off This is ignored when following pulse time is 100 0x00 high byte Pulse time 0x00...

Страница 45: ...ack the states of all 32 relays virtual and actual relays Bit 7 of byte 2 is relay 32 through to bit 0 of byte 5 which is relay 1 Byte 2 Byte 3 Byte 4 Byte 5 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 If the bit is set the relay is on off otherwise 0x34 0x01 Get Input 2 byte command returnin...

Страница 46: ... NACK non zero If a bit is high 1 the corresponding relay will be turned on If a bit is low 0 the corresponding relay will be turned off This command therefore affects all relays The bit order is the same as the Get Relay command Byte 2 Byte 3 Byte 4 Byte 5 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5...

Страница 47: ...he C and Java applications are com plete and may be used or modified as you wish To prevent re play or Playback attacks the command packet includes a Nonce This takes the form of a 32 bit 4 byte random number in positions 12 13 14 15 of the 16 byte data packet For example when you send a Get Status command 0x30 you will get a 16 byte block returned The first 8 bytes 0 7 will be as defined for the ...

Страница 48: ...ponse 0x00 xx xx xx xx xx xx xx xx xx xx xx 0x1A 0x2B 0x3C 0x4D Set Relay 0x31 0x02 0x01 0x00 0x00 0x00 0x00 xx xx xx xx xx 0x1A 0x2B 0x3C 0x4D Response 0x00 xx xx xx xx xx xx xx xx xx xx xx 0xF1 0xE2 0xD3 0xC4 Set Output 0x32 0x03 0x01 xx xx xx xx xx xx xx xx xx 0xF1 0xE2 0xD3 0xC4 Response 0x00 xx xx xx xx xx xx xx xx xx xx xx 0x5C 0x47 0x9B 0xED If the Nounce you send with the command does not ...

Страница 49: ...s Register 9 Counter1 high word Register 10 Counter1 low word Register 11 Counter2 high word Register 12 Counter2 low word Register 13 Counter3 high word Register 14 Counter3 low word Register 15 Counter4 high word Register 16 Counter4 low word Register 17 Counter5 high word Register 18 Counter5 low word Register 19 Counter6 high word Register 20 Counter6 low word Register 21 Counter7 high word Re...

Страница 50: ...the I O s 1 4 remapped to coils 41 44 Error code 1 This error is returned if an unknown or unimplemented function is received Only functions 1 4 5 15 are implemented Error code 2 This error is returned if an illegal address is requested Addresses greater than 15 for functions 1 5 or greater than 7 for function 4 will generate this error Error code 3 This error is returned if an illegal data value ...

Страница 51: ...cumentation Go to the Installation directory and click setup to install the dScript IDE if you have already installed a previous version you will need to uninstall it before installing the new one The USBdriver folder contains the USB com port driver for the modules Copy the Examples directory to a convenient location on your computer it contains both dScript source code examples and associated we...

Страница 52: ...in the Module panel you should see v1 01 indicates it s the boot loader that is running 7 Load the project File Open project dScriptPublish Examples app dS1242 v4 10 app dS1242 v4 10 dsj 8 Substitute the path for where you placed the dScriptPublish folder Click the blue world button if you need to search for the folder 9 Click the build button white triangle on green button This will update the sy...

Страница 53: ...n the right panel is quickest Just below this is a commented out line init Uncomment this by removing the semicolon Now upload the application and it will reset the IP address along with all other variables Confirm the board is operating but don t change anything yet You need to replace the semicolon and upload the application again otherwise it will continue to reset everything each time you powe...

Страница 54: ...volt free input from relay or switch contacts etc 2 analogue inputs 0 3 3v level and 1 serial port 3 3v level The module is powered from a 12vdc supply which can be regulated or unregulated The relays are SPCO Single Pole Change Over types The normally open normally closed and common pins are all available on the screw terminals Copyright 2016 2021 Devantech Ltd All rights reserved www robot elect...

Страница 55: ...the board begins running user programs The three user LEDs are available and can be controlled as digitalports 33 35 digitalport LedBlue 33 digitalport LedGreen 34 digitalport LedRed 35 The FlashingLeds example provides a colourful display showing how to use them Power supply The dS1242 requires a 12v DC supply capable of supplying a minimum of 500mA This is most easily provided by a low cost main...

Страница 56: ...osed output and a normally open output The relay coil is powered by the 12vdc incom ing supply on user command Coil C Relay in passive state NC NO Coil C Relay in powered state NC NO A full datasheet for the relays used on the dS1242 is here HF115FD datasheet Copyright 2016 2021 Devantech Ltd All rights reserved www robot electronics co uk 56 ...

Страница 57: ... or sourcing current depending on its type The outputs will sink current up to 100mA max when active The same principle applies to the inputs these are designed to allow you to directly connect a VFC Volt Free Contact This could be from other relay contacts thermostat contacts alarm contacts etc When the contacts are closed the input will read as active In fact anything that pulls the input pin do...

Страница 58: ...put connect a relay You can connect your own 12V relays the first coil pin of the relay is wired to the 12V supply terminals on the board the other is wired to the out put pin P When the output pin be comes active it is driven down to 0V ground the relay will have 12V across the terminals and switch so COM is connected to NO Representative Digital I O Schematic Copyright 2016 2021 Devantech Ltd Al...

Страница 59: ... nothing is connected 5V inputs can be used although the 3 3V to 5V region will merely read full scale Examples Example input connecting a poten tiometer Connecting a potentiometer should be the simplest of tasks either end of the pot should be wired to the 5v and 0v respectively the output pin of the pot is then wired into the analogue A pin Please note the reading from the conversion will reach ...

Страница 60: ... BrdTemp BrdTemp TS1 3223 500000 10000 This will give you the approximate temperature in C Power supply input voltage A simple resistive divider on analogue channel 101 is used to measure the 12v input voltage analogport PSU 101 DC power voltage int32 Volts Volts PSU 18369 100000 calc input voltage This will give you volts 10 So 119 11 9v 120 is 12 0v Analogue channels 1 Analog1 2 Analog2 100 Temp...

Страница 61: ...t Most 5v TTL level serial ports will accept a full 3 3v input ensur ing the port is compatible with most 5v de vices such as the LCD05 display modules That is the reason 5v rather than 3 3v is available on pin1 to power external modules The 5v supply can source up to 200mA Keep the leads short and away from high voltages Copyright 2016 2021 Devantech Ltd All rights reserved www robot electronics ...

Страница 62: ...dS1242 dS1242 User Manual v4 10 dS1242 dimensions Copyright 2016 2021 Devantech Ltd All rights reserved www robot electronics co uk 62 ...

Страница 63: ...dS1242 dS1242 User Manual v4 10 Notes Copyright 2016 2021 Devantech Ltd All rights reserved www robot electronics co uk 63 ...

Отзывы: