Reading PLC register using ModBusTCPCom in .Net results in address not found - .net-4.0

I have to update an old WinForms application. The application uses the AdvancedHMI .NET software.
I am connecting to the PLC (AutomationDirect DirectLogic 06 Series) with no issues, and various other registers are being read accurately.
I am expecting to get a 4 digit value from the register.
I am reading it like so:
Dim rawValue As String = BeltSpeedModbusTcpCom.Read("V3103")
When I read the register I get address not found.
The ladderlogic diagram I am was given is:
I have tried adjusting the address, using 03103, F3103, and other combinations. We can view the address values in real time in the PLC using software the customer has.

According to Page 4-13 of the DL-06 manual, the ā€œVā€ register number is Octal. Try reading ā€œ1603ā€, which is octal 3103 converted to decimal.

Related

Hardware implementation of Data Encryption Standard (S-boxes /permutations)

I am trying to implement the DES circuit and according to a lot of papers, the S-boxes usually is implemented using a SRL or LUT, i'm not familiar with SRL, so i thought i use 8 LUT, each one has 6 adress lines and 4 data lines ( the 1st 2 adress lines represent the 1st and last bits of the bloc, and the 4 other adress lines represent the rest which will define the column)
For example if we take S-box 1 (shown in this figure)
Here is the table that comes with it
That's just for one box, it seems to me wrong, to do all of the boxes we have to write 512 lines. My first question is: is a LUT a hardware component? if so, i am using it correctly? and, is there a more appropriate implementation or representation?
My second question is: what does it mean hardware wiring? I found out that all the permutation function could be implemented using wire crossing, i didn't understand it. Should i make a wire for every bit?

VB.net sending/recieving AT commands from SIM Card

ok, so i have been using Vb for a while but brand new to communicating with devices.
I have a HP Elitebook 820 which has a SIM card slot, what id like to do is display the SIM card info - specifically the serial number. I have done a bit of searching and found lots of people talking about AT commands. after a bit more searching i gave it a try.
Dim com1 As SerialPort = New System.IO.Ports.SerialPort
com1.PortName = "COM6"
com1.Open()
If com1.IsOpen Then
com1.Write("AT+CIMI")
Dim result As String
result = com1.ReadExisting
MsgBox(result)
Else
MsgBox("port not open")
End If
No Errors but just blank string returned. Could anyone help me out by letting me know, first if this even possible and second am i going about it the right way?
Step 1. Fetch a copy of the V.250 modem standard and read at least all of chapter 5. That will teach you a lot of basic AT command handling, like for instance that an AT command line should be terminated with \r.
Step 2. The very best documentation is your modem manufacturer's specific documentation which you definitely should try to get hold of that, however for basic mobile phone commands like AT+CIMI you can use the 3GPP spec 27.007 as well (assuming the manufacturer has not deviated in its implementation. Sometimes they do for some commands so this is something to watch out for (hence my recommendation to first and foremost get the modem manufacturer's specific documentation). The AT+CIMI command is however so simple there is nothing to deviate from really.).
Step 3. The reception handling, e.g. result = com1.ReadExisting is way too simplistic. You MUST read and parse every single line of response from the modem until you get a Final result code back (most commonly OK or ERROR, but there are several others). Any other way cannot work reliably. See this answer for pseudo code structure of how to do it properly.

TK 103 data format

I am trying to decode the Hex data sent by the device to my server. I am able parse the latitude , longitude ,speed etc. But what I am unable to decode is the 'state' information. I believe they represent the state of the vehicle e.g. oil and electricity, ignition on/off etc.
I cant find any document which can guide me as to how to decode the 8 bits of state and what each bit represents.
Any help or documentation for the same will be appreciated.
This is what I have been able to find out.
8 bits of IO:
First bit represents Power : 0 indicating on, 1 indicating off
Second bit represents Ignition status: 1 indicating ACC on, 0 indicating ACC off.
Other reservations.
Source: http://www.traccar.org/docs/protocol.jsp
Probably state is related to Valid / Invalid position.
Try it out, by comparing the value when having GPS free view to sky, and without (disabel Antenna, shield with metall paper trash bin or metall foil.
If this may help, I just release a new server base on a jison grammar to make protocol easier to implement. https://www.npmjs.org/package/gpsdtracking

Confused by the report ID when using HIDAPI through USB

I am a USB HID newbie and I am trying to use the HIDAPI for my application.
I have a question about using HIDAPI (in Visual Studio) regarding the report ID.
When I try to use the HIDAPI and connect to the Microchip Custom Demo,
I am confused about this aspect: The 65-byte report does not make sense to me!
Even if I don't want to set a report ID, I need to set the first byte to 0 and send the 65-byte buffer to the device, but I only receive 64 bytes of data from the Microchip device (because the report is 64 bytes long).
It looks like:
**Host** **Device**
*write_hid*
65 byte --------------->
*read_hid*
<------------------ 64byte
However, it seems weird to me.
Isn't the report that is sent or received always 64 bytes? Because the specifications say the report should have a 64-byte maximum and be sent every 1 ms.
If the answer is yes, why does the API maintain 65 bytes for 1-byte report ID?
Is the report ID contained in the 64 bytes?
The 65-byte data length does not make sense to me.
If your application does not include a Report ID in the HID descriptor, then there shouldn't be a Report ID prepended.
As you can see in the documentation of hid_write, HIDAPI should only send 64-bytes if the first byte is 0 (i.e. there is no Report ID):
unsigned char data[65];
buf[0] = 0; /* Single report */
// Fill report starting at buf[1]
hid_write(device, data, sizeof(data));
When looking at the source code for the libusb implementation, you can see that the Report ID is correctly stripped. On Windows however, the data is passed straight to Windows. I don't know Windows programming, but perhaps this makes a difference. Try testing this on Linux instead.

Get most frequently used applications in VB.NET

Is there a way that I can get the most used applications via VB.NET? I'm developing a sort of hobby project as a quick launcher kind of thing and thought this would sit perfectly on the main form.
If possible, would somebody be able to explain to me how add/remove applications manages to get the frequency of used applications? It would be good if I could get it in a list like the XP/Vista start menu as well.
Any guidance would be greatly appreciated. :)
It looks like you can find information on how often a program is run in the registry key:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist\
There's more explanation here and a .NET program here that you could reverse engineer to get at the count values using VB.Net.
This might be a decent place to start. It seems like windows does a crappy job of determining frequency of applications use.
http://blogs.msdn.com/oldnewthing/archive/2004/07/09/178342.aspx
According to this posting the information is stored in the first 28 bytes of the SlowInfoCache Registry value found at the following key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Management\ARPCache
The format of the value is (in VB.Net):
Structure SlowInfoCache
Dim cLen As Integer ' size of the SlowInfoCache (552 bytes)
Dim Flag As Boolean ' has a name
Dim Size As Long ' program size in bytes
Dim LastUsed As Long ' API-style FILETIME
Dim Frequency As Integer ' 0-2 = rarely; 3-9 = occassionaly; 10+ = frequently
Dim Path As String ' remaining 524 bytes (max path of 260 + null) in unicode
End Structure
If you are interested in the other information displayed in Control Panel -> Add or Remove Programs you will find it listed for each product under the following Registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
Or course these solutions only track when the shell (explorer.exe) is used to start a program via a shortcut (all start menu items are shortcuts). That's why it is so inaccurate.
FWIW I'm not aware of any microcomputer operating system that tracks the execution frequency of program images.
I suggest for your launcher tool that you initially popule it with the shortcuts from the quicklaunch bar and just make it really easy for the user to configure rather than trying to do anything automatic - automatic stuff that doesn't work in the way the user expects is one of the most annoying aspects of user interface design.
One question you should ask yourself is how are you going to determine frequency?
Are you going to base it on the number of times and application is run, or based on the length of time that an application is run for?