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.


Messages - BC SYSTEMS

Pages: 1 ... 4 5 [6] 7 8 ... 10
76
Technical support / Re:Nano Relays
« on: April 15, 2011, 11:32:12 AM »
Ok thanks.  

Cheers

77
Technical support / Nano Relays
« on: April 15, 2011, 02:28:33 AM »
Hi Guys,

I'm using the outputs on a nano to indicate if the communication on the serial and Ethernet port is working OK.  I need all four outputs which is fine for  outputs 1 & 2 but 3 & 4 are also connected to relays.

When the comm's is running the relays are on and off every second which is probably not doing them any good but perhaps more important, they are driving me mad!

Would there be any adverse situations if I just de-solder the relays.

Cheers


78
Technical support / Re:Serial communications
« on: April 13, 2011, 08:53:19 AM »
Thanks Gary,

I'm not sure why I can't compile that will carry on trying!


79
Technical support / Re:Serial communications
« on: April 13, 2011, 02:38:59 AM »
Hi Guys,

Thanks for your response (Gary and Tri).  I have re arranged and modified the code a bit and now it works as required  :)

******CODE******

CLRIO NEXT_CALL

A$ = INPUT$(1)                        ' CHECK FOR DATA ON COMM PORT 1

IF LEN(A$)= 0
SETLCD 0,0,chr$(1)                     ' 1 SENT TO LCD WILL CLEAR SCREEN
SETLCD 0,1,CHR$(12)                   ' NO CURSOR
SETLCD 1,1, "NO TIMING MAP DATA"    
B = B + 1                           ' COUNTS NO DATA RECEIVED
ENDIF

IF LEN(A$) > 0                        ' LOOK TO SEE IF RETURN STRING IS > 0
A = A + 1                           ' COUNTS DATA RECEIVED
SETIO RX_LED_RELAY                     ' SET RX LED
B$ = MID$(A$, LEN(A$)-5, 4)               ' COPY LAST FOUR BYTES (-5) AND NUMBER OF BYTES LONG
ENDIF

DM[1] = HEXVAL(B$)                      'CONVERT RECEIVED DATA FROM HEX TO DEC

SETLCD 0,0,CHR$(1)                     ' 1 SENT TO LCD WILL CLEAR SCREEN        
SETLCD 0,1,CHR$(12)                   ' NO CURSOR
SETLCD 1,1, "TIMING MAP = " +STR$(DM[1],2)

IF A = 0
SETIO TX_LED_RELAY                     ' SET TX LED
PRINT #1 "50002402000E00027A"              ' ASK CCM FOR SPEED TIMING MAP 0 -255
ENDIF

IF
A > 0                              ' WHEN NUMBER OF REPLIES = 1 MOVE ON TO NEXT CALL
SETIO NEXT_CALL
B = 0
A = 0
ENDIF


*******************

On another note... the following will not compile. I have tried many different permutation with () and "" but cannot get it right!!


PRINT #1 "50003402000E000DFF" + STR$(C$) +"50"

the C$ contains a hex variable I want to add to the string (F).

The other the problem is calculating the new checksum.  In this case "50" is the check sum of the whole message.  I use =CheckSum(xx) in excel to calculate the whole message CS but was wondering if it can be calculated in the PLC before sending?

Otherwise I could use a load of IF statements i.e

IF
C$ = xx
Print #1 "A"
ENDIF

IF
C$ = xx
Print #1 "B"
ENDIF

etc

Cheers

80
Technical support / Re:Serial communications
« on: April 12, 2011, 06:41:03 AM »
Hi guys,

Can you help as I'm pulling my hair out on this one.

I'm using a sequencer to step through my program, each step sends out a different string.  the sequencer is advanced via relay NEXT_CALL.  this sequencer just goes round in circles as long as the data is coming in.  Each step has a fixed 1 second timer contact in series with the sequence step to re-call the custfn

Each call sends a string out of comm 1.  If no data is received I increment B and return to the caller forever..... B counts the transmit attempts

If data is received, I convert the data from hex to dec and store in DM
  • and increment A.


when A >0 i want to move on to the next custfn for the next string etc.

This all works fine except after data has been received I want to move on and not re send the same string.

If you look at the attachement you will see I send the data out to my serial listerning tool a couple of times then I force a reply (highlighted in blue)  at this point I want to move  to the next custfn but I always send the original string before moving on to the next string and I cannot get rid of it!

I have tried only sending the string out of comm 1 if A = 0 but this doesnt stop this happening either.....  i.e

IF
A = 0
PRINT #1 "50002402000E00027A"
ENDIF

***********ACTUAL CODE****************

CLRIO NEXT_CALL



SETIO TX_LED_RELAY                     ' SET TX LED
PRINT #1 "50002402000E00027A"              ' ASK CCM FOR SPEED TIMING MAP 0 -255



A$ = INPUT$(1)                        ' CHECK FOR DATA ON COMM PORT 1

IF LEN(A$)= 0
SETLCD 0,0,chr$(1)                     ' 1 SENT TO LCD WILL CLEAR SCREEN
SETLCD 0,1,CHR$(12)                   ' NO CURSOR
SETLCD 1,1, "NO TIMING MAP DATA"    
B = B + 1                           ' COUNTS NO DATA RECEIVED
RETURN                             ' NO DATA HAS BEEN RECEIVED
ENDIF


IF LEN(A$) > 0                        ' LOOK TO SEE IF RETURN STRING IS > 0
A = A + 1                           ' COUNTS DATA RECEIVED
SETIO RX_LED_RELAY                     ' SET RX LED
B$ = MID$(A$, LEN(A$)-5, 4)               ' COPY LAST FOUR BYTES (-5) AND NUMBER OF BYTES LONG
ENDIF

DM[1] = HEXVAL(B$)                      'CONVERT RECEIVED DATA FROM HEX TO DEC

SETLCD 0,0,CHR$(1)                     ' 1 SENT TO LCD WILL CLEAR SCREEN        
SETLCD 0,1,CHR$(12)                   ' NO CURSOR
SETLCD 1,1, "TIMING MAP = " +STR$(DM[1],2)

IF
A > 0                              ' WHEN NUMBER OF REPLIES = 1 MOVE ON TO NEXT CALL
SETIO NEXT_CALL
B = 0
A = 0
ENDIF

81
Technical support / Re:Serial communications
« on: April 11, 2011, 03:43:20 AM »
Hi Guys,

It looks like my generic USB serial port was causing the errors??  I don't know whay as I cannot  re-produce the errors but as a precaution have placed it in my box of bits for worring about later!

I have now got my U485 up and running and all looks great.

Thaks for the help.

Cheers

82
Technical support / Re:Serial communications
« on: April 05, 2011, 08:37:38 AM »
Correct, this is captured from the serial tool connected to the actual device.

I dont get these additional characters which is why i thought maybe the PLC was generating them??

Will update when I get new data.

83
Technical support / Re:Serial communications
« on: April 04, 2011, 10:51:35 AM »
Guy's

To clarify.

I'm not trying to capture the strings and monitor online via the same comm port.  As below I send some strings from the PLC via a 1 sec pulse, I use the serial tool to capture the data and send some strings back.

I use the same tool onsite where the device is located without any additional characters appearing in the strings. See attached.

I will try to monitor online via the RS485 if i get the U485 working.....

Cheers

84
Technical support / Re:Serial communications
« on: April 04, 2011, 06:31:57 AM »
Hi,

I run the program in the PLC (TMD2424) and capture the data from the RS232 port using the Listen32 program.  after a few strings I pause the PLC, stop the Listen program and go online with the PLC using the same port.  No other hardware is present??

I tried watching with my U485 but i cannot get it to connect to the PLC?? (seperate issue!!)

Works a treat in simulation but not in real life??

Cheers

85
Technical support / Re:Serial communications
« on: April 04, 2011, 04:26:23 AM »
Hi Guys,

I'm seeing differnt results using the simulator and actual program in the PLC.

In SIM mode.

I'm using the following command:

PRINT #1 "50002404000E00027A"

I send back via the popup screen.

506125050E00400BB913

I then use the following to get the data I want

IF LEN(A$) >= 4????????????????????????' LOOK TO SEE IF RETURN STRING IS > 4
SETIO RX_LED????????????????????????' SET RX LED
B$ = MID$(A$, LEN(A$)-5, 4)???????????????' COPY LAST FOR BYTES (-5) AND NUMBER OF BYTES LONG
A = A + 1???????????????????????????' COUNTS DATA RECEIVED
CLRIO RX_LED ????????????????????????' CLR TX LED
ENDIF

DM[1] = HEXVAL(B$)????????????????????? 'CONVERT RECEIVED DATA FROM HEX TO DEC

The last four bytes are 0BB9, when converted and stored into DM[1] I Get 3001 - this works perfectly.

PLC Mode

When I monitor the PLC program with a serial program called Listern32, the string the plc sends out is

11:59:39:469  04-Apr-2011 Port  9 - 50002404000E00027A[CR]
50002[SP]A"[STX][STX][STX]*[ENQ][DC3]&[CAN]27A[CR]
50002404000E00027A[CR]
50002404[SP]A[STX]*[ENQ][DC3]&[CAN]27A[CR]
50002404000E00027A[CR]
50002404000[NUL]A[STX][STX][DC2]:[NL]Ux50002404000E00027A[CR]
0002404000E00027A[CR]
50002404000E00027A[CR]
50002404000E00027A[CR]
50002404000E00027A[CR]
50002404000E00027A[CR]
50002404000E00027A[CR]
5000240[SP]A[STX][STX]*[ENQ][DC3]&[CAN]27A[CR]
50002404000E00027A[CR]


as you can see the communication is garbled every now and then with some [STX][STX]*[ENQ][DC3]& characters??

when I send back

506125050E00400BB913[CR]

The PLC reads the data  from A$, in B$ I read 1CL4 and the DM has 7508 insted of 3001

Any Ideas??

Cheers





86
Technical support / Re:Serial communications
« on: April 01, 2011, 12:54:28 PM »
Thanks, I would have been ages on that!

I had to change it slightly as the above included the checksum to:

IF LEN(A$) >= 4
  B$ = MID$(A$, LEN(A$)-5, 4)  // -5
ENDIF

Since B$ is Hex data you convert into a number using the HEXVAL function:

DM[1] = HEXVAL(B$)

Many thanks

87
Technical support / Serial communications
« on: April 01, 2011, 10:56:15 AM »
Hi,

I'm using the following print command to send a string out or comm port 1.

PRINT #1 "50002404000E00403A" + chr$(13)    

A$ = INPUT$(1)

The data from the device is received at A$ no problem in the following format:

506125050E00400BB913

I'm only intrested in the last four bytes of data before the CS i.e 0BB9 when this is converted from hex to dec I get 3001.

I then want to put this value into a DM so my HMI can access the variable.

Not even sure where to start with this so any help appreciated.

Cheers


88
Technical support / Re:W7 x64 download problems
« on: March 12, 2011, 12:14:43 PM »
Hi,

I was connected directly via a crossover cable......

Will try again on Monday.

Cheers

89
Technical support / Re:W7 x64 download problems
« on: March 12, 2011, 12:26:45 AM »
HI,

Sorry, it was via the ethernet.  interested in the U485 drivers as well, is there a link on your site?

Cheers

90
Technical support / W7 x64 download problems
« on: March 11, 2011, 11:56:32 AM »
Hi,

I was trying to download the nano ethernet sample program on my W7 x 64 PC (tri 6.4).  half way during the download the transfer would fail (freeze).  swapped over to my XP machine V6.3 and all was ok.

Not sure if you have seen this but thought I would let you know... if you need any further testing please let me know.

Cheers


Pages: 1 ... 4 5 [6] 7 8 ... 10