Jump to content

As of July 17, 2015, the LabJack forums here at forums.labjack.com are shut down. New registrations, topics, and replies are disabled. All forums are in a read-only state for archive purposes.

Please visit our current forums at labjack.com/forums to view and make new posts. To post on the current forums, use your labjack.com login account. Your old LabJack forums login credentials have been retired. There are no longer separate logins for labjack.com and LabJack forums.


Photo

Watchdog vb.net help


  • Please log in to reply
3 replies to this topic

#1 0TinMan0

0TinMan0
  • Members
  • 2 posts

Posted 06 December 2012 - 04:41 AM

I'm having trouble using the watchdog in VB.NET From the background reading I've done it looks like the funciton, LJ_chWDT_Enable is not allowed in the code and may have been replaced by 5200/ 5201 please help me out with some code Best regards

#2 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 06 December 2012 - 07:57 AM

For the function, you want to use ePut, eGet, or some sort of add/go/get block. Then to enable the watchdog you use the iotype LJ_ioSWDT_CONFIG with the special channel LJ_chSWDT_ENABLE (not LJ_chWDT_Enable).

See the pseudocode here:

http://labjack.com/s...rs-guide/4.3.13

Plug that pseudocode into your .NET program, making the small verbage changes needed for .NET, and if you have a problem post a code snippet.

#3 0TinMan0

0TinMan0
  • Members
  • 2 posts

Posted 06 December 2012 - 09:16 AM

Thanks for the rapid response, although I'm still having a problem with the WDT. I'm using visual studio .net The code I have tells the WDT to reset on detection is: LJUD.Addrequest(IngHandle, LJUD.IO.put_config, LJUD.Channel.SWDT_Reset_Device, 1,0,0) 'This works OK (I think) Then the problem I have is what code to tell the WDT to be enabled and wait for 60sec, I think it is something like:... LJUD.AddRequest(IngHandle,LJUD.IO.SWDT_Config, LJUD.Channel. ??? ,60,0,0) But VB.NET will not allow SWDT_Enable where the ??? is above Please help Kind Regards

#4 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 06 December 2012 - 03:05 PM

Thanks for the rapid response, although I'm still having a problem with the WDT. I'm using visual studio .net

The code I have tells the WDT to reset on detection is:

LJUD.Addrequest(IngHandle, LJUD.IO.put_config, LJUD.Channel.SWDT_Reset_Device, 1,0,0) 'This works OK (I think)

Then the problem I have is what code to tell the WDT to be enabled and wait for 60sec, I think it is something like:...

LJUD.AddRequest(IngHandle,LJUD.IO.SWDT_Config, LJUD.Channel. ??? ,60,0,0)

But VB.NET will not allow SWDT_Enable where the ??? is above

Please help

Kind Regards


The following constants are defined for .NET:

SWDT_ENABLE = 5200,
SWDT_DISABLE = 5201,

So the following should work:

LJUD.AddRequest(IngHandle,LJUD.IO.SWDT_CONFIG, LJUD.CHANNEL.SWDT_ENABLE ,60,0,0)

You should be using capital letters for all the constants, though I'm not sure if that matters in VB.NET. If you are getting an error for that, what error are you getting? The following should also worK:

LJUD.AddRequest(IngHandle,LJUD.IO.SWDT_CONFIG, (LJUD.CHANNEL) 5200 ,60,0,0)


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users