Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - evanh

Pages: [1]
1
Technical support / How compiled is the code?
« on: November 11, 2005, 09:39:24 PM »
Here is my first test program that sits in a single custom function on a "Norm.On" rung.  There is a second DiffUpCustFunction on a 1.0 second pulse that prints the value of "j" to the LCD.  That's the whole program.

What I'm getting concerned about is that the below code continuously cycles at a rate of only 160 odd Hertz.  That is about one hundredth of the pace that I was hoping for.  :(

This function should compile to less than 40 instructions and if that's running in embedded program space on say a 10 MIPS core then we have a 4 microsecond execution time for this section which leaves 6246 usecs for the refresh cycle of two analogue inputs.  ;)


Code: [Select]
a = adc(1) : b = adc(2) 'Snap readings

i = (i + 1) & &H0f
j = j + 1
dm[i+1] = abs(a - b) 'Insert computed error
c = dm[1]+dm[2]+dm[3]+dm[4]+dm[5]+dm[6]+dm[7]+dm[8]+dm[9]+dm[10]+dm[11]+dm[12]+dm[13]+dm[14]+dm[15]+dm[16]
c = c * 3125/8192 'Convert to mA, (100 / 20 * 5000 / 4096 / 16)

if c > 100
  clrio RUNNING
endif


Evan

2
Technical support / Direct I/O
« on: November 11, 2005, 08:58:30 PM »
Is there any commands that perform direct I/O instead of working with the "refreshed" I/O data?

This is a very important feature within interrupts as the time it takes for a refresh cycle to be forced is usually excessive.


Evan

3
Technical support / Compile/Download bug
« on: November 11, 2005, 05:19:18 AM »
I'm not sure what's going wrong but having just written me first program for a T100MD+ I am a bit green on what's legal code and the procedure for downloading to the PLC.

What I've found is that using a custom function as an input bit in the ladder is not valid code.  A couple of interesting effects occur if one tries to do this:
 1 - The simulator compiles and runs without complaint.
 2 - The real PLC download doesn't even appear to attempt it's compile cycle and therefore doesn't send any code either.

So, apart from the discrepancy in the two procedures, there is no error or warnings produced by any of the compile runs.


Evan

4
Technical support / ADC normalisation
« on: November 11, 2005, 03:45:23 AM »
This is a recommendation:

The instruction manual states clearly that the normalisation is a simple bit shift that scales the value up to 12 bit resolution.  No complaints with the documentation.

However, I feel it'd be better if the scaling stretched to the full range of the 12 bit resolution.  It'd be a two or three instruction operation instead of the existing one instruction.  Something like:  
Code: [Select]
CopyOfADC = RealADC[x];  InternalADC[x] = (CopyOfADC << 2) | (CopyOfADC >> 8);

Cheers,
Evan

5
Technical support / TLServer21.jar may not like J2SE 1.5.0
« on: November 10, 2005, 07:52:29 PM »
Below is a dump of the error message.  There is a real COM1 on this laptop and it works with all the miriad of other PLC packages I use.  The editor, TL53.jar is working fine.  A side note:  The reason why I have not reported this earlier is because this is the first time I personally tried to program our T100MD+.  The usual laptop is not here for me to compare with at the moment.


Installation Directory = C:\APPS\TRiLOGI\TL5/
Serialio.SerialPortLocal: version 9.1: build 9104
Copyright (c) 1996-2002 Serialio.com, All Rights Reserved.
os.name="Windows 98"  os.arch="x86"
java.lang.UnsatisfiedLinkError: no jspWin in java.library.path: Check that nativ
e library jspWin is in proper directory
Serial ports reported by system:
COM1;COM2;COM3;COM4;fsdir = C:\APPS\TRiLOGI\TL5/FileService/
Getting Server IP addresses from O/S
IP Address 1 = acer-tm220/192.168.156.159
java.lang.UnsatisfiedLinkError: SerOpenPort
java.lang.UnsatisfiedLinkError: SerOpenPort
        at Serialio.SerialPortLocal.SerOpenPort(Native Method)
        at Serialio.SerialPortLocal.open(Unknown Source)
        at Serialio.SerialPortLocal.<init>(Unknown Source)
        at b.f.a(Unknown Source)
        at b.f.new(Unknown Source)
        at TLServer21.TLServer.<init>(Unknown Source)
        at TLServer21.TLServer.main(Unknown Source)

6
Technical support / TL53.jar almost works native in Linux
« on: November 05, 2005, 08:25:37 PM »
I've recently been experimenting with setting up the office with a Linux based PC and just installed SetupTL5.exe under the MEPIS distro using CrossOver.  After chasing missing icons I found that there were plain .jar files that could be run straight from Linux.  I did so, using the command from TL5.bat, and the editor popped up just fine.  :)

Sadly, apon trying to load an example PLC program it would fail saying it couldn't find the file.  :(  However, I can make a new program and save and reload it in the examples directory so there must be a file format problem (eg: CR/LF vs LF only).

Also, it's getting tons of font errors listed via stdout/stderr which, not surprisingly, causes much lose of info in the rendering of the editor.

I suspect there is not much stopping this.

I tried running the server using "java -DSERIAL_PORT_LIST=/dev/ttyS0  -jar TLServer21.jar" but it was less succesfull complaining that:
java.lang.UnsatisfiedLinkError: SerOpenPort
        at Serialio.SerialPortLocal.SerOpenPort(Native Method)
        at Serialio.SerialPortLocal.open(Unknown Source)
        at Serialio.SerialPortLocal.<init>(Unknown Source)
        at b.f.a(Unknown Source)
        at b.f.new(Unknown Source)

Anyone in the development team been experimenting?


Evan

Pages: [1]