Here are the examples of the csharp api class FileDriver.MemoryReader.FindPosition(DeviceAddress) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
13 Examples
0
1. Example
Project: SharpSCADA
Source File: MemoryDriver.cs
Source File: MemoryDriver.cs
public byte[] ReadBytes(DeviceAddress address, ushort size) { byte[] bytes = new byte[size]; try { int result = accessor.ReadArray(FindPosition(address), bytes, 0, size); return bytes; } catch { return null; } }
0
2. Example
Project: SharpSCADA
Source File: MemoryDriver.cs
Source File: MemoryDriver.cs
public ItemData<int> ReadInt32(DeviceAddress address) { try { return new ItemData<int>(accessor.ReadInt32(FindPosition(address)), 0, QUALITIES.QUALITY_GOOD); } catch { return new ItemData<int>(0, 0, QUALITIES.QUALITY_BAD); } }
0
3. Example
Project: SharpSCADA
Source File: MemoryDriver.cs
Source File: MemoryDriver.cs
public ItemData<short> ReadInt16(DeviceAddress address) { try { return new ItemData<short>(accessor.ReadInt16(FindPosition(address)), 0, QUALITIES.QUALITY_GOOD); } catch { return new ItemData<short>(0, 0, QUALITIES.QUALITY_BAD); } }
0
4. Example
Project: SharpSCADA
Source File: MemoryDriver.cs
Source File: MemoryDriver.cs
public ItemData<byte> ReadByte(DeviceAddress address) { try { return new ItemData<byte>(accessor.ReadByte(FindPosition(address)), 0, QUALITIES.QUALITY_GOOD); } catch { return new ItemData<byte>(0, 0, QUALITIES.QUALITY_BAD); } }
0
5. Example
Project: SharpSCADA
Source File: MemoryDriver.cs
Source File: MemoryDriver.cs
public ItemData<float> ReadFloat(DeviceAddress address) { try { return new ItemData<float>(accessor.ReadSingle(FindPosition(address)), 0, QUALITIES.QUALITY_GOOD); } catch { return new ItemData<float>(0f, 0, QUALITIES.QUALITY_BAD); } }
0
6. Example
Project: SharpSCADA
Source File: MemoryDriver.cs
Source File: MemoryDriver.cs
public ItemData<bool> ReadBit(DeviceAddress address) { try { return new ItemData<bool>(accessor.ReadBoolean(FindPosition(address)), 0, QUALITIES.QUALITY_GOOD); } catch { return new ItemData<bool>(false, 0, QUALITIES.QUALITY_BAD); } }
0
7. Example
Project: SharpSCADA
Source File: MemoryDriver.cs
Source File: MemoryDriver.cs
public int WriteBytes(DeviceAddress address, byte[] bit) { try { accessor.WriteArray(FindPosition(address), bit, 0, bit.Length); return 0; } catch { return -1; } }
0
8. Example
Project: SharpSCADA
Source File: MemoryDriver.cs
Source File: MemoryDriver.cs
public int WriteBit(DeviceAddress address, bool bit) { try { accessor.Write(FindPosition(address), bit); return 0; } catch { return -1; } }
0
9. Example
Project: SharpSCADA
Source File: MemoryDriver.cs
Source File: MemoryDriver.cs
public int WriteBits(DeviceAddress address, byte bits) { try { accessor.Write(FindPosition(address), bits); return 0; } catch { return -1; } }
0
10. Example
Project: SharpSCADA
Source File: MemoryDriver.cs
Source File: MemoryDriver.cs
public int WriteInt16(DeviceAddress address, short value) { try { accessor.Write(FindPosition(address), value); return 0; } catch { return -1; } }
0
11. Example
Project: SharpSCADA
Source File: MemoryDriver.cs
Source File: MemoryDriver.cs
public int WriteInt32(DeviceAddress address, int value) { try { accessor.Write(FindPosition(address), value); return 0; } catch { return -1; } }
0
12. Example
Project: SharpSCADA
Source File: MemoryDriver.cs
Source File: MemoryDriver.cs
public int WriteFloat(DeviceAddress address, float value) { try { accessor.Write(FindPosition(address), value); return 0; } catch { return -1; } }
0
13. Example
Project: SharpSCADA
Source File: MemoryDriver.cs
Source File: MemoryDriver.cs
public ItemData<string> ReadString(DeviceAddress address, ushort size) { try { byte[] bytes = new byte[size]; int result = accessor.ReadArray(FindPosition(address), bytes, 0, bytes.Length); return new ItemData<string>(Encoding.ASCII.GetString(bytes), 0, QUALITIES.QUALITY_GOOD); } catch { return new ItemData<string>(null, 0, QUALITIES.QUALITY_BAD); } }