Modbus TCP/IP Address to PLC Addess - tcpclient

I want to add 0 between the two four number in the plc address you see in the picture.
Should I use left shift?
Can u help me ?
PLC Address = 404606 --> I want value
Plc Address = 440606 --> value shown to me

Good ol' Modbus. After re-reading your question, I believe you are trying to target Application Address for Holding Register 404606. The edit control is wanting the decimal wire offset of the Holding Register (e.g. for 40020, you would enter 19).
So, to get HR 404606 for the PLC Address static text, you want to enter 4605 in the edit control.

You are confusing application layer address with the wire address. The Modbus FC basically defines the leading digit (0, 1, 3, or 4, i.e. Coils, (Discrete) Inputs, Input Registers, Holding Registers).
So at the application layer, the holding register
4001
40001
400001
all would look "identical" on the wire. The wire "offset" is 1 less than the application "offset" (i.e. app layer 40001 is offset 0x0000 on the wire). There is no way to specify the number of application layer digits on the wire.
What we've done is stick with 5 digits, and when the wire offset gets past 9999 (0x270F or more on the wire is 10000 or more at the app level), switch to a 6 digit application layer address, i.e.
49999 (5 digit app layer)
next HR is displayed as
410000 (6 digit app layer)
up to
465536 (65536 offset is 0xFFFF on the wire)
There is no "shifting" necessary at the packet level (if that's what you are thinking).

Related

matching network BLE antenna

Hi I'm using a BLE module connected to a chip antenna, the antenna manufacture establish the path width is .4mm, if I need to match the network to 50ohm how can I do it? the system has a pi-match C1=0.8pF L=3.9nH and C2 is 0.8pF how can I make sure it match to 50 ohm?
Your network contain 2 parts:
Antenna + pi-match
BLE module
You need to make sure both 2 part meet the requirement 50 ohm itself so you have to isolate 2 part.
(You can use the knife to remove a small path in the transmission line)
After isolation, use a 50ohm cable, solder one side of cable to each part, other side to the Vector network analyzer.
If the S-parameter you got is <-8dB in your frequency range => You got 50 ohm matching.
(Try change value of your pi to got value close to 50ohm)

shift register(74hc595) and pic in ccs

When I write 8 bit in hc595 shift register, with i2c last bit go to Q0 in second hc595.
Why?
Schematic:
My code:
i2c_write(0b10101010);
latch_led_sensors_out();
delay_ms(200);
It's because of the I2C protocol. Even though you want to send out 8 bits, you are really sending out 9. The way I2C works is the initial frame contains 7 (or 10) bits of address, plus one bit for read/write. After those initial 8 bits are clocked out, the master sends an additional clock pulse to read in the ACK/NACK bit from the slave device. Remember, the master controls the clock, even when the slave is driving the data pin.

Network layer Lan network

When we sent packets from one router to another router on the network layer and the packet size is greater than the MTU (maximum transferable unit) of the router, we have to fragment the packet. My questions is: suppose we need to add padding bits in last fragment, then where do we add padding bits (in the LSB or MSB) and how does the destination router differentiate between packet bits or padding bits?
I want you to consider the following things before:
Limit on the maximum size of IP data-gram is imposed by data link protocol.
IP is the highest layer protocol that is implemented both at routers and hosts.
Reassembly of original data-grams is only done at destination host. This takes off the extra work that need to be done by the routers present in the network core.
I will use the information from the following image to help you get to the answer with an example.
Here initial length of the packet is 2400 bytes which needs to to fragmented according to MTU limit of 1000 bytes.
There are only 13 bits available for the fragment offset and the offset is given as a multiple of eight bytes. This is why the data fields in first and second fragment has size of 976 bytes (It is the highest number divisible by 8, which is smaller than 1000 - 20 bytes). This makes first and second fragment of total size of 996 bytes. The last fragment contains the remaining of 428 bytes of payload (with 448 bytes of total).
Offset can be calculated as 0; 976/8 = 122 and 1952/8 = 244.
When these fragments reach the destination host, reassembly needs to be done. Host uses identification, flag and fragmentation offset for this task. In order to make sure which fragments belong to which data-gram, host uses source, destination addresses and identification to uniquely identify them. Offset values and more fragment bits are used to determine whether all fragments have arrived or not.
Answer to your question
The need to divide payload into multiples of 8 is only required for non-last fragment. Reason of using offset dividing by 8 helps the host to identify the starting address of the next fragment. The host don't need the address of the next fragment if it encounters the last fragment. Thus, no need to worry about payload being multiple of 8 in case of last fragment. Host checks the more fragment flag to identify the last fragment.
A bit of additional information: It is not the responsibility of the network layer to guarantee the delivery of the data-gram. If it encounters that one or more fragment(s) have not arrived then, it simply discards the whole data-gram. Transport layer, which is working above network layer, will take care of this thing, if it is using TCP, by asking the source to re-transmit the data.
Reference: Computer Networking-A Top Down Approach, James F. Kurose, Keith W. Ross (Fifth Edition)
You don't need to add any padding bits. All bits will be push on down the route until the full frame has been sent.

4 digit 7 segment & 8 buttons normal keypad on single port (PORTC) if PIC Microcontroller

I am using PIC16F882 (28 pins) microcontroller.
I have the hardware in which 4 digit seven segment (common anode & connected by 4 transistor via PORT B1 TO B4) and 8 buttons normal keypad in connected to single PORT pins (PORT C). Now i am able to run 4 digit seven segment without using any buttons. I have to write a code in which when i press button then only the display should get on and show some value.
Now my problem is that, to recognize keypad i have to make (initialize) port pins as input and to place value in display i have to make port (initialize) pins as output pins. So how can i operate display with the keypad who are connected to same port.
I tried to scan keypad and display one by one for 1ms but keypad is not working. ( controller is am not able to recognize a key press). Doing this scanning process when i see the voltage at any key i found floating value of 1.56 V & 2.65 V (Without pressing key) No change in voltage when i press key.
I don't know what should i do? I need some idea or concept which i can try to implement.
Please Help.
Thanks in advance.
I think you better use a chip which has more ports for your project (say pic16F877) so that you can have the 7 segment display on 1 port (portB) and the other port (portC) to turn on/off the segment that you like. PortD used for keypad. If you use separate port like I mentioned above, it saves a lot of your time when you have to look at your circuit as well as the code. You can have a look at this link below from Trini Robotics to see how they control the 7 Segment Display:
http://trinirobotics.com/?p=652

Cell (cell-id), BTS and BSS in GSM network

what is the relation between BTS and cell? I think one BTS hardware can cover few cells and also some cells could be covered by more than one BTS isn't it?
Is part of information, that mobile receives from GSM network identification of concrete BTS or mobile phone knows only cell-id?
Is part of information, that mobile receives from GSM network identification of BSC?
Ad 1: Typically one BTS can handle several cells. Common patterns are a one BTS covering a circular area with one round-radiating antenna or a three-sector BTS which covers three cells with sector-radiating antennas. One cell can only be handed by one BTS at a time. Two or more BTSes are not possible since the radio communication would interfere with each other. Note that this is completely different in WCDMA/UMTS since there is no concept of cells.
Ad 2: Since one cell is covered by exactly one BTS, the cell id uniquely identified the concrete BTS.
Ad 3: Since the BTS does not contain any control logic, the mobile communicates directly with the BSC, e.g. about radio resources.
Edit after comment:
1/ The BTS is "dumb" to say it simply. It does only what the BSC instructs it to do. E.g. The BSC tells the BTS as well as the mobile which frequencies to use for the radio communication. A BTS does not route traffic as it is hooked to exactly one BSC. It even does not route traffic to one of several mobiles attached to the BTS as this is done by the BSC. Think of the BTS as a Um-to-Abis physical layer and protocol transcoder.
2/ Actually my earlier statement that UMTS has no cell concept is not exactly true, it's just different.
GSM is FTDMA (frequency and time division multiple access). The radio channel is shared by using different frequecies (per cell) and timeslots (per mobile). Since radio frequency is used to distinguish participants, great care must be taken that not two GSM participants use the same frequency at the same time at the same location. The solution to this is cells, where geographic areas have different frequencies assigned. Network planning must ensure that no two neighbouring cells use the same frequencies as this may lead to interference since you cannot control exactly the size of a cell (e.g. due to absorption and reflection). In GSM, a BTS has a fixed number of radio transmission channels, the number depends on the BTS hardware configuration. If all channels are in use, the cell is full, this is indpendent of the location of a mobile in the cell.
UMTS is CDMA (code division multiple access). The radio channel is shared by encoding the payload in a way that allows to decode it later even if several senders use the same frequency range. That requires coding schemes which are collision free (all codes are different from each other to avoid senders using too similar codes) and a great deal of signal processing. As an analogy: on a party you can understand someone accross the room, even if ten people are talking. The more senders communicate within the cell, the smaller the cell gets in order to allow the BTS/Node-B distinguishing between senders. Therefore, in UMTS a cell size is not geographically fixed. The cell "breathes" depending on its load.
OK, this thread is quite old, but requires some further clarifications for next generations.
When talking about GSM physical network architecture, the term BTS (Base Transceiver System) refers to the physical site itself - the 'small house with the tower' (although modern small BTSs are just boxes hanged on walls or placed on roof tops).
Each such physical site can host one omni-directional cell, or several sector cells.
In GSM logical network architecture, there is some confusion.
The terms 'Cell' and 'Base Station' actually refer to the same physical entity (a set of transceiver units, each used to receive and transmit one of the paired UL/DL carrier frequencies allocated in the BA frequency set). Let's call this entity 'physical cell' just for clarification.
The term Base Station is used for radio resource management. A BSIC (BS Id Code, or BTS Id Code) is allocated for the 'physical cell' and is used in the radio-related conversations between the MS (Mobile Station) and the BSS (BTS and BSC), e.g. for measurement reports.
The BSIC is composed of 'local' parameters - Network Color Code (NCC) and BS Color Code (BCC), and is therefore unknown outside the network.
This is where the term Cell comes in:
The term Cell is used for Mobility Management. A Cell Identity (CI) is defined as a refinement of the Routing Area - one RA will include several cells in it.
The Global Cell Identifier (GCI) is composed of network, RA and CI, and is used for handovers inside and outside the network.
It is up to the BSC to convert the BSIC to the Cell Identity (the BSC may convert the BSIC directly to GCI, or the BSC converts to CI, and the MSC will convert it to GCI).
Hope that helps a bit.
BTS means different at different place!
MS, BTS, BSC, when these words appear together, BTS means something between your phone and the MSC.
Sometimes we call a site (a small house and a tower) as a BTS.
In NOKIA gsm equipment,cell is called segment. Every cell has at least one BTS,different BTS has different functions,Eg:BTS1 provide voice service,BTS2 provide EDGE service。
Phone get BCCH(freq)/NCC/BCC to identificate different cells. Decode the information from BCCH to get CI, LAC...etc.

Resources