1747-NC13

This is a basic straight through cables. Pin 1 to 1 etc.

This cable is male to female.

Male Head Female Head
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
NC NC

In this cable pin is not connected.

Example uses:

  • Linking TD36 to KE cards

MBOC Installing

Please note this does not apply to the newer QxUD range, as it isn’t required.

MOBC is multiple block online change. When you are doing a online program change MBOC will allow for larger change to be done, or more smaller changes, without needing to redownload the PLC code. The MBOC reveres a sections of space at the end of program, which is shuffles me code into.

This is done by (noting that the below complete wipe all program, variable and parameters).

  • Selecting the “Online” dropdown menu
  • Selecting “Format Drive”
  • The following popup will appear
  • Make sure that the MBOC is set to 4K Steps, and then select “Format”

To check if a PLC has had the MBOC set up, you need to go

  • Select the “Online” dropdown menu
  • Select “File Info” option
  • If the highlight option shown below (MBOC.QMB) is in the list then MBOC has been correctly implemented

Distance Measuring With Ultra Sonic

Theory

So the hardware works by having the echo high for the time it take for the pulse to return. The software blip the trigpulse on, and then time the duration of the echo pulse. Then a bit a maths is done and the function returns a distance in cm.

Hardware Required

So you need the following hardware:

  • Arduino board and power supply
  • Ultrasonic sensor for Arduino (I got mine from Ebay for just over a pound)

Noting that mine had 1 pin for pulse, and 1 pulse for distance.

Hardware Setup

So the ultrasonic sensor has 4 pins, (or at least the version I’ve got does)

Connect VCC to VCC

Connect GND to GND

Connect Trig to the pin you code has for pulse_req_pin

Connect Echo to pulse_return_pin

Code

 


long measure_distance(int pulse_req_pin, int pulse_return_pin)
{ //based upon https://www.arduino.cc/en/Tutorial/Ping?from=Tutorial.UltrasoundSensor
  // establish variables for duration of the ping, 
  // and the distance result in inches and centimeters:
  long duration, cm;

  // The PING))) is triggered by a HIGH pulse of 2 or more microseconds.
  // Give a short LOW pulse beforehand to ensure a clean HIGH pulse:
  pinMode(pulse_req_pin, OUTPUT);
  digitalWrite(pulse_req_pin, LOW);
  delayMicroseconds(2);
  digitalWrite(pulse_req_pin, HIGH);
  delayMicroseconds(5);
  digitalWrite(pulse_req_pin, LOW);

  //HIGH pulse whose duration is the time (in microseconds) from the sending
  // of the ping to the reception of its echo off of an object.
  pinMode(pulse_return_pin, INPUT);
  duration = pulseIn(pulse_return_pin, HIGH);

  // convert the time into a distance
  // The speed of sound is 340 m/s or 29 microseconds per centimeter.
  // The ping travels out and back, so to find the distance of the
  // object we take half of the distance travelled.
  cm = duration / 29 / 2;

  return(cm);
  
  //Serial.print(cm);
  //Serial.print("cm");
  //Serial.println();

}

I haven’t tried this a module yet, but it works as a function.

Modbus Ethernet Slave Address Mits

Switch setting are for switch 2 – 0004

Switch 3 and 4 are the IP address octives converted into HEX

Switch 1 and 5 are all zero

Modbus address relocate

Upload / Download PV550 Using PCMCIA Card

Firstly you need the following equipment:

  • PV 550 (i.e. the HMI you after the program from)
  • PCMCIA to Compact flash adepter (cheap of eBay)
  • Small CompactFlash Card (MB yes Mega Byte, again eBay)
  • USB to Compact flash (assuming that you computer does have either a reader or a PCMIA slot)

Access Memory Card

To upload from the HMI, you need to know the password, and follow these steps:

  • Insert the CompactFlash card into the PCMCIA card
  • Insert the PCMCIA into the HMI (as shown below)

IMG_20141117_135140

  • Press both the right and left arrow key (you will be prompt to enter your password)

IMG_20141117_135200

  • Select memory card and press the enter key

IMG_20141117_135526

  • Then the following is shown where you can upload / download programs

 IMG_20141117_135435

To Upload To The Memory Card

  •  Firstly format the memory card (needs to be in FAT16), using the F4 key
  • Then save to card using the F3 key
  • Then dismount card (using F5 key) and following the on screen instructions

To Download To The Panel View

The card needs to be formatted to FAT16

  • Save the application to the memory card before the above steps
    • Using File -> Download -> Memory Card , then select type etc
  • Then Restore from card (F2)

 

Raspberry PI and Eye-Fi

Let start with the basic, Eye-fi can’t use a FTP, on a local private network, or any other method due to requirement of the files being send to their server first and then being send to that FTP. This was a fail in my attempt to get this working.

So, using the following website, and some brain power:

Requirements

  • One Raspberry PI functioning as a access point
  • One Windows Machine
  • One EyeFi Card
  • A USB card reader

Setting Up The EyeFi Card

The following are to be done on a Windows 7 Machine

  • Insert the Eyefi card
  • Install the Eyefi application off the Eyefi card
  • Register the card, (and create an account if need be)
  • Set the card up to talk to your Raspberry PI access point
  • Set the card to save to somewhere on your computer (don’t set up on internet, and it doesn’t matter where you set it to on your computer as the PI setting will override)
  • This was located here (where user_name is changed with your username) – noting that this location might change for different versions

C:\Users\User_Name\AppData\Roaming\Eye-Fi\Settings.xml

  • You need the Card Mac Address and UploadKey out of this folder
  • Eject the card and stick it in your camera

Setting Up The Raspberry PI

So once the above is done, the following needs to be done on the PI

  • Download, and unzip the Eyefiserver2 from Github
  • In the Eyefiserver2 directory you just unzipped, open the file /etc/eyefiserver.conf
  • Insert into this the MacAddress and UploadKey (one per card)
  • Edit the location where you want to save the file to
  • Save and close this file
  • Now I ended up using sudo cp, copying the files list below (from the eyefiserver directory) to the corresponding (copied from the github start page)
    .
    |-- etc
    |   |-- eyefiserver.conf
    |   `-- init.d
    |       `-- eyefiserver
    |-- usr
    |   `-- local
    |       `-- bin
    |           `-- eyefiserver.py
    `-- var
        `-- log
            `-- eyefiserver.log
e.g.
sudo cp /home/pi/etc/eyefiserver.conf /etc/
sudo cp /home/pi/etc/init.d/eyefiserver.conf /etc/init.d/
etc
  • Create a blank file called /var/log/eyefiserver.log
  • Now we need to make /usr/local/bin/eyefiserver.py executable so

sudo chmod a+x /usr/local/bin/eyefiserver.py

sudo chmod a+x /etc/init.d/eyefiserver – just in case (I did this first so was unable to test just the py mode)

  • To make this run on statup the following command needs to be run in terminal (I have no clue what it does)

sudo update-rc.d eyefisever 98 02

  • Now restart the PI, and snap away

Possible issue – if you have enabled pass through on your PI to your wider network (i.e. Windows machine) then the photos might end up on the Windows PC instead of the PI, there no logic to where it save to (as far as I can see).

Inserting a Google Doc Graph Into WordPress.com

To create and insert a graph into WordPress from Google docs, the following steps need to be done:

  • Create the spreadsheet and make the graph you want to publish
  • Select in the top right cornea the arrow, and then select publish

Publishing Graph part1

  • In the popup the appears, select the publishing option as Image

Publishing Graph part2

  • Copy the html code
  • Then paste it into the wordpress page/post into the “Text” tab at the top right cornea

 

I would like to know why the interactive graph doesn’t work, but this does the job.

Connecting USB Device To Virtual Box

During this guide I will be using the phrase ‘host machine’ to define the actual computer operating system, and ‘virtual machine’ to define the virtual computer.

On Virtual Box this is achieve by the following steps:

  • Insert the USB device into the host machine
  • Allowing the host machine to realise that there is something plugged into it
  • On the virtual machine
    • If your running in fully screen mode use the top menu

usb vbox middle

    • If your running in window mode, right click on the USB symbol

 

usb vbox bottom right

  • Once selected the device which you want to move across, the host machine may require that you agree to using none Microsoft approve drivers,
  • The Virtual machine then needs to load the drivers for the device

Now the device should be usable for virtual machine.

 

Find a Lost Android Device

Below is only one possible method, and there are many more.

This requires the following to be able to find it

  • It must be powered
  • It must have an active internet connection
  • It must be linked to your Google account (and you must be able to remotely install apps)

 

So to do this

  • Go to Google Play Store
  • Install Android Device Manager on to your lost device
  • On play store, press the setting button on the top right cornea
  • Select Android Device Manager
  • You will be prompt to renter you password
  • This will then take you to a Google Maps of where you phone is
  • You then get the option to make it ring, using that and it position data from Google maps you should hopefully find it again.

Creating a Menu In Google Sheets

This wonderfulling thing call Google Script

  • So you need a Google account,
  • Open or create a sheets page
  • Go “Tools” then “Script Editor…”

Then use the following as an example, see comment for how it works.

 

//Function output hellow world to browser window
function helloWorld() {
  Browser.msgBox("Hello World");
}

//Function output text to browser window
function Test2() {
  Browser.msgBox("Eho Test 2");
}

//Function output text to browser window
function morningWorld() { 
  Browser.msgBox("Morning World");
}

//Is run on sheet open
function onOpen(){
  var menuEntries = [
    //Creates a menu
    { name : "Say it in English", functionName : "helloWorld" }, //Calls helloWorld
    null, //Adds a line as a break
    { name : "Test 2", functionName : "Test2" }, //Calls Test2
    { name : "Good morning", functionName : "morningWorld" } //Calls morningWorld
   ];
   SpreadsheetApp.getActiveSpreadsheet().addMenu( "Demo Menu", menuEntries ); //Add the menu to the sheet

}

Design a site like this with WordPress.com
Get started