NetTalk Central

Author Topic: NetRefresh problem not always working  (Read 24691 times)

pdc95

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • Email
NetRefresh problem not always working
« on: February 24, 2009, 02:51:41 AM »
Using Clarion 5.5 Netalk 3.26.
I have an application where a PC receives multiple RS232 data streams from several alarm panels.
This data is stored in a TPS file and dispalyed on a matrix on a window.
Controls are available on the matrix to issue TCP-IP command to silence the panels.
The client requires aditional PC's to dispaly the same data and issued silence commands.
The same clarion app is run on all PC's across the network and all share the same data file.
Some times it works fine but most of the time the controls on the slave machines cause the main PC to reflect the changes but the changes made on the master machine are not seen by the slave's.
ThisNetRefresh.send() is run on each addition or removal of data in the data file and when any control is accepted.
It always works on the master but seldom on the slaves.
Help !

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: NetRefresh problem not always working
« Reply #1 on: February 24, 2009, 07:20:19 AM »
Hi PDC,

Probably the first thing to do is download the latest build of NetTalk 3.

It's pretty hard to comment otherwise, based on your description.
There is a setting (property) which allows you to set a refresh "limit". ie if multiple refreshes arrive closely after each other, the system can be set to "ignore" subsequent refreshes. I'm thinking in your case you should set this property quite low.

Cheers
Bruce


pdc95

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • Email
Re: NetRefresh problem not always working
« Reply #2 on: February 25, 2009, 12:29:43 AM »
Hi Bruce

I have installed the latest release of Net Talk 3 (3.40).
I have set the the refres limit to 1 ( it was already).

What I am having problems understanding is the refresh always works from slave to master (accepting any control results in the master mimic and the file being updated) but master to slave (accepting any control or new items being added to the file or items being removed from the file do not result in an update of the slave).

The same exe file is being used the slave loading it from the master over the network.

It once sprung to life and worked but the next time it was run it stopped and has not worked again ?.

Any idea

Regards
Pete Crowe

pdc95

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • Email
Re: NetRefresh problem not always working
« Reply #3 on: February 25, 2009, 05:40:38 AM »
Hi Bruce

I think that I have solved the problem.
I am developing the app on the master machine and if I run the app from the clarion IDE then NetRefresh outgoing does not work.
If I run it as an exe file the Net Refresh outgoing seems to work (needs a lot more testing yet).
Is this what you would expect ?.

Having installed the latest version on Net Talk 3, I now get an error message when I edit the embeds on the page that has Nettalk as an extension.
Exiting the embed editor I get a generator message 'Unknown Variable %HasSaveButton'
I get the same message on pressing OK on the Procedure Property window.
Any idea what might be causing this.

Regards
Pete Crowe

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: NetRefresh problem not always working
« Reply #4 on: February 25, 2009, 09:52:04 PM »
Make a small edit to your NetTalk.Tpl file. It's in your \3rdparty\template folder.
The two lines in red below need to be added.
I don't know if this will fix it, but it's worth a try. Let me know, if it does fix the issue then I'll fold this into the Ver 3 build.

#Extension(Local_Use_NetRefresh,'NetTalk: NetRefresh'),Procedure,req(Use_NetRefresh)
#prepare
  #declare(%HasSaveButton,long)
  #declare(%SendRefreshCommandText)
  #set(%SendRefreshCommandText,'Send Refresh Command at CloseWindow')
  #IF(VarExists(%HasSaveButton))
    #set(%HasSaveButton,0)
    #FOR(%ActiveTemplate),WHERE(%ActiveTemplate='SaveButton(ABC)')
      #set(%HasSaveButton,1)
      #set(%SendRefreshCommandText,'Send Refresh Command at OK Button Accept')
    #ENDFOR
    #FOR(%ActiveTemplate),WHERE(%ActiveTemplate='SaveButton(Clarion)')
      #set(%HasSaveButton,1)
      #set(%SendRefreshCommandText,'Send Refresh Command at OK Button Accept')
    #ENDFOR
  #ENDIF

Cheers
Bruce

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: NetRefresh problem not always working
« Reply #5 on: February 25, 2009, 09:53:37 PM »
Hi Pete,

I wouldn't _expect_ it to fail under the IDE, but it implies the problem is a firewall, or virus checker, which is blocking the communications between the 2 programs.

Cheers
Bruce

pdc95

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • Email
Re: NetRefresh problem not always working
« Reply #6 on: February 26, 2009, 12:28:04 AM »
Hi Bruce

The change to the template file did not work same error displayed.
Adding a save button does not stop the error ?

I have no Firewall or Virus checker running on either machine as I suspected this at the start.

I can live with it but do not understand it.

Regards
Pete

pdc95

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • Email
Re: NetRefresh problem not always working
« Reply #7 on: March 02, 2009, 02:10:06 AM »
Hi Bruce

This problem is getting weirder !

If a start the Slave PC program first follwed by the Master PC program then each program see's the NetRefresh commands issued by either and it functions as expected.

If I start the Master PC program first followed by the Slave PC program then the slave does not see the NetRefresh commands issued by the Master PC.
If some events have occured before the Slave PC is turned on it reads the data from the shared file and display it and the controls on the slave function and the Master see's the NetRefresh commands issued by the Slave but the Slave does not see any commands issed by the Master PC as a result of controls pressed or new event occuring.

In normal use the Master PC will be running 24/7 while the slave PC's will be turned on and off as required hence the syatem will not function.

What might be causing this and how to fix it ?

Regards
Pete

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: NetRefresh problem not always working
« Reply #8 on: March 02, 2009, 06:24:50 AM »
Hi Pete,

My guess is that there is some firewall,  or router, on your LAN that is blocking the packets.

You can add some logging to your app at a low level (ie in the PROCESS method of the netrefresh object) which will let you see the raw data of incoming packets.

But from your description it sounds like something is blocking. Can you duplicate the effect with the example? Can you duplicate the effect with your program on a different network?

(Incidentally, during your testing, are you running multiple copies of your program on the same machine?)

Cheers
Bruce


pdc95

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • Email
Re: NetRefresh problem not always working
« Reply #9 on: March 02, 2009, 09:24:04 AM »
Hi Bruce

I have no firewall on either computer.
I have 2 PC's and 2 Xports on fixed IP address's all connected via a 5 port switch, I have no router on the network..
I have only 1 copy of the program running on each machine.

As the program works as required if the programs are started in a particular sequence it does not seem that blocking is the problem, or the blocking would occure no matter what the sequence.

I do not have access to another network at my location and will have to try to get access to another site.

I will try the example tomorrow but I am shure that it worked when I tried it several weeks ago before I advised the client that I could do the job.

I am at a loss on this.

Regards
Pete

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: NetRefresh problem not always working
« Reply #10 on: March 02, 2009, 10:41:40 PM »
Hi Pete,

It does sound strange.
If you have any Anti-Virus software try disabling that. A lot of AV software can interfere with networking if they suspect something is wrong.

I presume you haven't done any adjustments to the port numbers, or number of ports using the NETOPTIONS command?

You can also "force" the slave to connect to the parent, if you know the IP address of the parent. Use the NetRemote call (see docs) to do this. This will bypass the UDP mechanism which it typically uses to connect.

Cheers
Bruce

pdc95

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • Email
Re: NetRefresh problem not always working
« Reply #11 on: March 03, 2009, 01:03:09 AM »
Hi Bruce

I was using AVG8 but has uninstalled it from both machines.
Windows security center report NO Firewall NO Antivirus.

I have not changed the ports.

I have now tried the example and have the same problem I am loading the remote Slave) machine with the example over the network from the compiling (Master) machine.

If I start the Netrefresh example on the Master machine and then start a second instance on the Slave machine changes made by the Slave are not refreshed on the Master and changes made by the Master are not refreshed on the Slave.

If however I start the programs in the reverse order every thing is fine.

I have not changed the example program in any way.

Can you replecate this on your network ?

Regards
Pete

pdc95

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • Email
Re: NetRefresh problem not always working
« Reply #12 on: March 03, 2009, 05:25:42 AM »
Hi Bruce

I have just returned from testing the NetRefresh example on a mate's network and have had the same results ie
Works if programs loaded in one sequence but not in the reverse sequence.

Help ?

Regards
Pete

pdc95

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • Email
Re: NetRefresh problem not always working
« Reply #13 on: March 05, 2009, 04:50:26 AM »
Hi Bruce

I have resolved what has been causing my problem.
My mate has got the example working on his network.
I have taken my slave machine down to his network and I have the same problem on that machine.

I am using an IBM Thinkpad T41 so the problem seems to be related to this machine.
We are unable to come to any conclusion as to what might be causing the problem but it seems to be machine dependant.

As I am a subcontractor to a subcontractor to a main contractor I have no knowledge of the hardware that my software will run on but am concerned that it might not run on some harware setups.

Do you have any experiance with IBM hardware that could shed some light on this problem.

Regards
Pete

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: NetRefresh problem not always working
« Reply #14 on: March 15, 2009, 10:42:56 PM »
Hi Pete,

It was a long, long time ago, but there was something at some point about multiple network cards in a single computer. The broadcast would propagate on the one LAN, but not the other.

This wasn't an identified issue until well after NetTalk 4 was in production. Since most computers only have 1 network interface this wasn't an issue. I think it became an issue on computers that had more than 1 interface (ie multiple network cards, or possible laptops where you're effectively connected to 2 LANS at the same time - ie if you're using wi-fi and ethernet at the same time.)

As I recall we updated NetTalk 4 to cope with this - but as I say it was years ago this happened to it's all a biy hazy in my recollection.

Cheers
Bruce